[Bug] AskUserQuestion does not block dependent tool calls until user responds
Bug Description
Title: AskUserQuestion does not gate subsequent tool calls — assistant edited files while a clarifying question was still pending
What happened:
I (the assistant) called the AskUserQuestion tool to ask the user a clarifying question ("keep the anti-nag behavior, or drop it?"). In the same turn, I also issued mutating tool calls (multiple
Edit calls and a psql command) that depended on the answer — and I had presupposed the wrong answer. So file edits started executing before the user had answered, implementing the opposite of what
the user then chose. The user could see edits happening while the question dialog was still open/unanswered.
Expected behavior:
When AskUserQuestion is used, any tool calls whose outcome depends on the answer should not run until the user responds. Ideally, issuing a question should block/defer the rest of the turn's
mutating actions (Edit/Write/Bash) until the answer is received, so the model can't act on a presupposed answer.
Actual behavior:
The question and the dependent edits were executed together in one turn; the edits proceeded on an assumed answer, contradicting the user's actual choice and requiring a manual revert.
Impact:
Wrong changes were applied to the working tree and the database based on a guessed answer, which then had to be discovered and undone. This erodes the whole point of asking a clarifying question.
Repro (rough):
Have the model, in a single assistant turn, emit an AskUserQuestion call alongside Edit/Bash calls that encode a specific answer to that question. Observe that the edits run regardless of (and
before) the user's selection.
Environment: Claude Code, model Opus 4.8 (1M context).
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.156
- Feedback ID: 159f737c-c6fb-4bc2-bc63-7d56047e79c6
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗