Skip to content

[Bug]: Claude Code runner does not wait for AskUserQuestion — agent continues without an answer #3808

@cbeaulieu-gt

Description

@cbeaulieu-gt

Before you submit

  • I searched existing issues and confirmed this is not a duplicate.
  • I replaced the example text with the real behavior, reproduction steps, expected result, and version.

What happened?

When the Claude Code runner emits an AskUserQuestion tool call, the runner does not pause for the user's answer — the agent continues executing on its own, even if no option is selected. The question card renders and is interactive (selecting an option flips it to a locked "accepted" state), but the run has already moved on by that point. I don't know whether it's even possible to submit an answer early enough for the agent to use it, or whether by the time the card is visible the agent has already continued.

This appears to happen because claude -p (headless print mode) does not block on host tool results: it auto-fires an error tool_result for the unanswered AskUserQuestion and continues the turn. Separately, the card's "accepted" state is set optimistically in the UI before/independently of any backend delivery, so it can look accepted even though the answer never reached the running agent.

Steps to reproduce

  1. Open Open Design (no custom skill or design system required).
  2. Start a chat run with the Claude Code runner and prompt the agent so it calls AskUserQuestion.
  3. Wait for the AskUserQuestion card to appear.
  4. Do nothing — do not select an option.
  5. Observe: the agent continues executing without waiting for any input.
  6. (Optionally) select an option afterward: the card flips to "accepted," but the run has already proceeded without it.

Expected behavior

When the agent calls AskUserQuestion, the runner should pause the run and wait for the user to choose an option and submit, then resume using that answer as the tool result. The agent should not continue until an answer has been provided (or the user explicitly dismisses/cancels).

Open Design version: 0.9.0 (stable)

Platform: Windows

Logs (optional): Not included — packaged stable app; the contributor pnpm tools-dev logs --json command assumes a local dev checkout. Happy to provide if a maintainer points to the installed Windows app's daemon log location.

Additional context

Root cause spans two layers: (1) Claude Code CLI — claude -p does not block on host tool results (expected for headless print mode); (2) Open-Design UI — ToolCard.tsx sets setSubmitted(true) before the POST to /api/runs/:id/tool-result resolves, so the card always appears accepted, and on a non-200 the onSubmitForm fallback sends the answer as a new user message (a fresh turn) rather than answering the pending tool call. Minimal UI-side fix: gate setSubmitted(true) on ok === true, and surface a clear failure when the answer can't be delivered.

🤖 Generated by Claude Code on behalf of @cbeaulieu-gt

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions