generated from nhcarrigan/template
feat: add AskUserQuestion tool support #60
Reference in New Issue
Block a user
Delete Branch "feat/ask"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements support for Claude's
AskUserQuestiontool, allowing Claude to ask the user questions with multiple choice options during a conversation.Changes
UserQuestionEventandQuestionOptiontypes (Rust and TypeScript)AskUserQuestionin permission denials and emitclaude:questioneventUserQuestionModalcomponent with option selection and custom answer inputPermissionModal) since Claude API doesn't accept tool_result for permission-denied toolspendingQuestionto conversation store andhasQuestionPendingderived storeTechnical Notes
We discovered that Claude Code's permission denial system doesn't allow sending tool results back directly - the API rejects them with "unexpected tool_use_id found in tool_result blocks". The solution was to use the same stop/reconnect pattern that permissions use: stop the session, reconnect with context, and include the user's answer in the context restoration message.
Test Plan
AskUserQuestionCloses #51
✨ This PR was created with help from Hikari~ 🌸