Skip to content

Show the question in AskUserQuestion permission notifications - #86

Open
RomanBOGR wants to merge 1 commit into
warpdotdev:mainfrom
RomanBOGR:permission-preview-ask-user-question
Open

Show the question in AskUserQuestion permission notifications#86
RomanBOGR wants to merge 1 commit into
warpdotdev:mainfrom
RomanBOGR:permission-preview-ask-user-question

Conversation

@RomanBOGR

Copy link
Copy Markdown

The preview in on-permission-request.sh is built from .command or .file_path, and everything else falls back to tostring[0:80]. For AskUserQuestion that fallback dumps raw JSON, so the notification reads

Wants to run AskUserQuestion: {"questions": [{"question":"Should we...

and gets truncated before the question itself.

This matters most when several Claude Code sessions run in parallel: the notification is the only thing visible from another tab, and a decision prompt is exactly the case where you want to know what is being asked before switching to it.

Adds one elif .questions branch, plus four tests covering Bash, Write, AskUserQuestion and the unknown-tool fallback — the preview expression had no coverage before. tests/test-hooks.sh: 61 passed, 0 failed.

🤖 Generated with Claude Code

The preview in on-permission-request.sh handles .command and .file_path and
falls back to tostring[0:80] for everything else. For AskUserQuestion that
fallback dumps raw JSON, so the notification truncates before the question
itself.

Add an elif branch for .questions, plus four tests covering Bash, Write,
AskUserQuestion and the unknown-tool fallback.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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