feat(cli): pass AskUserQuestion answers via permission RPC#803
Open
dragonkid wants to merge 1 commit intoslopus:mainfrom
Open
feat(cli): pass AskUserQuestion answers via permission RPC#803dragonkid wants to merge 1 commit intoslopus:mainfrom
dragonkid wants to merge 1 commit intoslopus:mainfrom
Conversation
When a permission response includes an `answers` field (Record<string, string>), merge it into the tool's updatedInput so Claude Code receives structured user selections in the AskUserQuestion tool result. This enables remote clients (mobile app, Discord bot) to send selected answers through the existing permission RPC without a separate sendMessage call.
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
answersfield (Record<string, string>), merge it into the tool'supdatedInputso Claude Code receives structured user selections in the AskUserQuestion tool resultsendMessagecallanswersfield is optional and backward-compatibleChanges
packages/happy-cli/src/claude/utils/permissionHandler.tsanswers?: Record<string, string>toPermissionResponseinterfacehandlePermissionResponseto mergeresponse.answersintoupdatedInputContext
Currently, remote clients like the Discord bot must use a two-step flow to answer AskUserQuestion:
approvePermission(RPC) — approves the tool callsendMessage(HTTP) — sends the answer text separatelyThis causes Claude to treat the answer as a new user message ("Other" free-text input) rather than a structured selection. With this change, answers are passed directly through
updatedInput.answers, which the Claude Code SDK natively supports.Test plan
answersfield in permission response🤖 Generated with Claude Code