Add AskUserQuestion hook#42
Open
novarii wants to merge 1 commit into
Open
Conversation
Wires up a PreToolUse hook for AskUserQuestion that emits a structured 'question_asked' event (already defined in Warp's CLI agent protocol and mapped to Blocked status). Without this, AskUserQuestion calls fire no Warp notification, so users miss prompts when not focused on Warp.
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
PreToolUsehook matched toAskUserQuestionso Claude pausing to ask the user a question triggers a Warp notification.question_askedevent already defined in Warp's CLI agent protocol (CLIAgentEventType::QuestionAsked, mapped toBlockedstatus incli_agent_sessions/mod.rs) — no Warp-side change needed.on-permission-request.sh: extracts the first question's text assummary, truncates to 200 chars, sends viawarp-notify.sh.Motivation
AskUserQuestionis one of the most frequent ways Claude blocks waiting for the user, but it currently produces no Warp notification. Users running Claude in the background miss prompts entirely unless they're already focused on the Warp pane. The Warp side has supported thequestion_askedevent since v1 of the protocol — the plugin just hasn't been emitting it.Test plan
tests/test-hooks.shpasses (40/40, including new silent-exit assertion for the script)build_payloadproduces:{"v":1,"agent":"claude","event":"question_asked","session_id":"abc","cwd":"/tmp/foo","project":"foo","summary":"Which option do you prefer?"}v1::parseexpects inevent/v1.rs.