Skip to content

fix(agent): don't execute when the user picks 'just chat' on an ask / 选"只是聊聊"不应直接执行#4163

Merged
esengine merged 1 commit into
main-v2from
fix/ask-just-chat-no-execute
Jun 12, 2026
Merged

fix(agent): don't execute when the user picks 'just chat' on an ask / 选"只是聊聊"不应直接执行#4163
esengine merged 1 commit into
main-v2from
fix/ask-just-chat-no-execute

Conversation

@esengine

Copy link
Copy Markdown
Owner

Summary

When the user dismisses an ask — the "Just chat" / "先不选择,直接回复" option, or esc — the chooser/desktop send empty answers, and formatAnswers rendered 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."

  • A fully-declined ask now returns an explicit stop signal: don't decide for me, let's just talk — do not pick an option, run a tool, or take further action; wait for the user's next message.
  • Partial answers (multi-question asks) now mark the skipped questions as (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 through AskToolformatAnswers, so one change covers both surfaces.

Test

  • go test ./internal/agent/ — adds TestAskToolDismissTellsModelToStopNotProceed (empty answers ⇒ stop/wait, no "(no answer)") and TestAskToolPartialAnswerMarksUnansweredQuestions (answered picks kept, skipped ones marked). Existing ask tests and the headless-fallback test still pass.
  • go vet ./internal/agent/.

Closes #4160

@esengine esengine requested a review from SivanCola as a code owner June 12, 2026 08:48
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development agent Core agent loop (internal/agent, internal/control) labels Jun 12, 2026
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.
@esengine esengine force-pushed the fix/ask-just-chat-no-execute branch from cc97d30 to abb63bc Compare June 12, 2026 08:53
@esengine esengine merged commit f48a241 into main-v2 Jun 12, 2026
13 checks passed
@esengine esengine deleted the fix/ask-just-chat-no-execute branch June 12, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 只是聊聊直接执行

1 participant