Repository navigation
fix: give the agent a per-turn effort recommendation - #25
Closed
BaconDroid wants to merge 6 commits into
Closed
BaconDroid wants to merge 6 commits into
BaconDroid wants to merge 6 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.
BaconDroid
force-pushed
the
feat/effort-recommendation
branch
from
October 19, 2026 18:11
1094652 to
a71910c
Compare
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
Addresses #22.
The report describes two failure modes: spurious
set_reasoning_effortcalls when the plugin pushed a separate imperative system message, and no calls at all when the guidance lived inAGENTS.md. #23 removes the second system message by merging intosystem[0]. This PR addresses the remaining behavior.Changes
chat.messageclassifies the prompt (sharingsrc/complexity.tswith feat: select reasoning effort from request complexity #24) and stores a recommendation for the turn.This turn suggests high effort (current: low). Call set_reasoning_effort with high before proceeding.The current level fits this request; call set_reasoning_effort only if the work grows beyond it.Call set_reasoning_effort only when the current level no longer fits the task.session.idle, so a shell turn or a text-less turn cannot inherit the previous turn's advice.autoSelectenabled (feat: select reasoning effort from request complexity #24), the plugin manages the level and the prompt says so, so the tool becomes an explicit override.Stacked on #23 and #24. This branch is based on
feat/auto-effort; review/merge #23 and #24 first. The diff will shrink after they land.Tests
autoSelectis enabled.pnpm verifypasses (24 tests, format, lint, typecheck, build).No prompt change can guarantee that a model calls a tool. This change makes the cue specific to the turn and removes the blanket instruction that correlated with spurious changes in the report.