fix(opencode): preserve command scope in subtask continuation message - #41874
Open
jaysonvirissimo wants to merge 1 commit into
Open
fix(opencode): preserve command scope in subtask continuation message#41874jaysonvirissimo wants to merge 1 commit into
jaysonvirissimo wants to merge 1 commit into
Conversation
After a subtask command completes, opencode injects a synthetic user message that says "continue with your task". The parent agent can read this as permission to act beyond the command scope. For example, it can start to fix findings from the review-only /review command. Change the message to name the command and defer further action to the user. Also restore the comment that explains why the message must exist. Fixes anomalyco#41866
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.
Issue for this PR
Closes #41866
Type of change
What does this PR do?
The synthetic user message injected after a user-invoked subtask command says "continue with your task".
But for the
/reviewcommand, that strongly suggests the model should fix any findings the subtask reported.This is unfortunate, since when you run that command you expect it to review a PR, not try to fix everything wrong with it.
The message itself cannot be removed.
PR #5650 added it because reasoning models like Gemini error when an assistant message has no user message after it.
So this PR keeps the message but changes its text.
The new text names the command that ran, asks for a summary of the output, and defers any further action to the user.
It also restores the code comment from #5650 that explains why the message must exist.
How did you verify your code works?
packages/opencode/test/session/prompt.test.tsScreenshots / recordings
Not a UI change.
Checklist