Repository navigation
feat: raise effort automatically on more complex turns - #26
Closed
BaconDroid wants to merge 8 commits into
Closed
BaconDroid wants to merge 8 commits into
BaconDroid wants to merge 8 commits into
Conversation
Repeated set_reasoning_effort calls in one turn could reset to an intermediate level, or cancel the reset entirely when the same level was set twice, because the baseline was re-read after the override. Keep the first reset target, read session history once per call with a bounded query, cache provider variants, merge guidance into an existing system prompt, and replace Zod config parsing with a small validator.
Fall back to the cached current level when the recent history window carries no variant, and read model identity and variants from assistant messages too. Reuse the SDK provider type for the cached provider list.
Add an opt-in autoSelect mode. The chat.message hook classifies each user request and writes the chosen variant onto the message, which OpenCode persists and uses for the turn. The level is carried across turns until the agent changes it or the model changes.
Respect a variant supplied with the request and treat image-only prompts as no signal. Document that autoSelect classifies the first request and carries the level instead of reclassifying every turn.
Classify each user turn and inject a specific instruction: call the tool with the recommended level when it differs, or do not call when the current level fits. Replace the blanket reassessment guidance with a shorter prompt that relies on the recommendation.
Clear the recommendation on session idle, keep mid-turn reassessment in the default guidance, and honor explicit variants as an override only in autoSelect. Raise the changeset to minor for the default prompt change.
In autoSelect, later user turns can raise the level when the request classifies higher. Downshifts stay recommendations, explicit variants and persisted tool choices lock the level, and short follow-ups keep it.
Author
|
Closing: depends on the classifier added in #24, which is being removed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #24 and #25 for the behavior discussed in #22.
autoSelectnow handles later turns instead of only the first:continue,ok, …) keep the current level.persist: truetool call, locks the level until a temporary tool call or a model change.This keeps the mode automatic where #22 hurt (later turns staying underpowered) without reintroducing automatic downshifts that can cut reasoning in the middle of a task. Follow-up detection stays English-only. No new configuration options.
Stacked on #23, #24 and #25. Review/merge those first; the diff will shrink after they land.
Tests
pnpm verifypasses (26 tests, format, lint, typecheck, build).