fix(agent): don't execute when the user picks 'just chat' on an ask / 选"只是聊聊"不应直接执行#4163
Merged
Merged
Conversation
When the user dismisses an ask (the "just chat" / 先不选择 option, or esc) the chooser sends empty answers, and formatAnswers rendered that as "- <q>: (no answer)". The model reads that as "no constraint" and acts unasked — e.g. it writes a config the user only wanted to discuss. Treat a fully-declined ask as an explicit stop signal: tell the model the user chose not to decide and to wait for their next message rather than take action. Partial answers now mark the skipped questions as "don't assume a choice" instead of a bare "(no answer)". Shared by CLI and desktop since both resolve the ask through AskTool.
cc97d30 to
abb63bc
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
When the user dismisses an
ask— the "Just chat" / "先不选择,直接回复" option, oresc— the chooser/desktop send empty answers, andformatAnswersrendered that to the model as- <question>: (no answer). The model reads "(no answer)" as no constraint and proceeds unasked: in #4160 the user picked "just chat" and the agent went ahead and wrote a statusline config anyway ("看来你没有明确选,我直接帮你配置").Root cause is purely the model-facing wording — "the user explicitly declined" was being phrased as "the user didn't answer."
(left unanswered — don't assume a choice)instead of a bare(no answer), so the model reports the real picks without fabricating the rest.Shared fix: CLI (
chooser) and desktop (onDismiss → answerQuestion(id, [])) both resolve the ask throughAskTool→formatAnswers, so one change covers both surfaces.Test
go test ./internal/agent/— addsTestAskToolDismissTellsModelToStopNotProceed(empty answers ⇒ stop/wait, no "(no answer)") andTestAskToolPartialAnswerMarksUnansweredQuestions(answered picks kept, skipped ones marked). Existing ask tests and the headless-fallback test still pass.go vet ./internal/agent/.Closes #4160