Skip to content

Render AskUserQuestion prompts as an option picker with keyboard shortcuts - #22

Merged
currentbits merged 1 commit into
mainfrom
coder/when-an-llm-asks-a-question-we-should-ha-5ce3a6
Aug 14, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/when-an-llm-asks-a-question-we-should-ha-5ce3a6

Conversation

@currentbits

Copy link
Copy Markdown
Owner

What

When an agent asks a question via the AskUserQuestion tool, the thread view previously fell through to the generic permission card: raw JSON input with Accept / Accept all / Deny — none of which actually answer the question. This PR renders a proper question screen instead, matching how the accept/approve prompt works today:

  • Numbered options (label + description) per question, selectable by click or the 1–9 keys; a lone single-select question submits instantly on choice.
  • Multi-select and multi-question prompts collect picks behind an Answer button; answers join labels with , .
  • An Other… free-text field per question, and Dismiss to decline (deny).
  • The thread log records Answered: <labels> instead of Allowed: AskUserQuestion.

How

The Claude CLI already routes AskUserQuestion through the same can_use_tool control request as any permission prompt, so this rides the existing pipe end to end:

  • electron/runner.js: questionInfo() attaches sanitized questions to PendingPermissionInfo; respondPermission accepts an optional answers map and merges it into the allow response as updatedInput.answers keyed by question text (the shape the CLI expects).
  • src/components/ThreadView.tsx: new QuestionPrompt component, rendered when pendingPermission.questions is present; non-question permissions are untouched.
  • Types/plumbing threaded through src/shared/ipc.ts, useCoder.ts, App.tsx.

Testing

  • New electron test: question fake-CLI scenario asserting the parsed questions surface to the renderer and the chosen answer round-trips in updatedInput.answers over the control protocol.

  • New renderer suite test/questionPrompt.test.tsx (5 tests): render, instant click-answer, number-key answer, multi-select collect + Answer, Dismiss denies.

  • tsc --noEmit clean; full electron (680/692) and renderer (711/712) suites show no new failures — the remaining ones (orch-server, app-memory) reproduce on a clean tree.

  • PR created by the Claude Code agent

When the agent asks a question (AskUserQuestion control request), render an
option picker like the permission prompt instead of raw JSON + Accept/Deny:
numbered options answerable by click or 1-9 keys, multi-select with an
Answer button, an Other free-text field, and Dismiss to decline. The chosen
labels ride back to the CLI as updatedInput.answers keyed by question text.

Co-Authored-By: Claude Fable 5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit 30d1a3a into main Aug 14, 2026
@currentbits
currentbits deleted the coder/when-an-llm-asks-a-question-we-should-ha-5ce3a6 branch October 3, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant