Fix mobile AskUserQuestion answers in plan mode#995
Open
kevin1sMe wants to merge 1 commit intoslopus:mainfrom
Open
Fix mobile AskUserQuestion answers in plan mode#995kevin1sMe wants to merge 1 commit intoslopus:mainfrom
kevin1sMe wants to merge 1 commit intoslopus:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AskUserQuestionsubmissions in plan mode so Claude receives structuredanswersinstead of an empty selection.updatedInput.updatedInputback into the original Claude tool input before allowing the tool call.Problem
When Claude asked a native
AskUserQuestionmultiple-choice question, the mobile app handled submission like this:That ordering is incorrect for
AskUserQuestion.Claude expects the user selections to be returned as part of the tool input itself, using the
answersfield onAskUserQuestionInput. Because the tool was approved before the structured answers were attached, Claude completed the tool call with empty answers.This produced behavior like:
{ "questions": [...], "answers": {} }and logs like:
The later mobile text message was treated as a normal user message rather than the result of the pending question tool call.
Fix
updatedInput?: Record<string, unknown>to the session permission RPC payload.AskUserQuestionViewto submit answers as structured data instead of sending a follow-up chat message.updatedInputinto the pending Claude tool input inpermissionHandler.tsbefore returningbehavior: 'allow'.Reproduction
planmode.AskUserQuestionmultiple-choice question.Validation
Manual
happy claude.AskUserQuestioninplanmode.Type checking
Ran successfully:
yarn workspace happy typecheckyarn workspace happy-app typecheckNotes
This PR is intentionally scoped to the
AskUserQuestionanswer transport path between the mobile app and Claude.