fix(task): rewrite main-session gate prompt to prevent self-answering#1738
Merged
Conversation
The task gate's reentry text told the model to 'complete the work then continue or respond', which caused it to answer its own questions and start new implementation when it should have been waiting for user input. Rewrite the main-session prompt to: - Offer 'use question tool' as the primary action when user input is needed - Keep 'continue working' as valid only when no user input is required - Add explicit negative constraints against self-answering - Mention question tool supports all inquiry types (choices, free-text, recommendations) - Preserve subagent prompt unchanged (different semantics)
6f21c6b to
50cbcf6
Compare
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
questiontool as the primary exit path when user input is neededProblem
When the model's turn is classified as "final" with open/in_progress tasks, the task gate injects a synthetic user message. The old prompt said:
This caused the model to, after asking the user a question:
Solution
Replace the main-session gate prompt with a structured decision tree:
questiontool (supports choices, free-text via empty options, recommendations)task donetask donetask blocktask abandonWhen the model uses the
questiontool, the turn is not classified as "final" (pending tool call), so the gate never re-fires.Subagent path is unchanged.