Fix AskUserQuestion pass-through emitting an invalid permission decision - #2373
Open
ilanbm wants to merge 1 commit into
Open
Fix AskUserQuestion pass-through emitting an invalid permission decision#2373ilanbm wants to merge 1 commit into
ilanbm wants to merge 1 commit into
Conversation
The question-preference hook's pass-through path returned permissionDecision: 'defer', which is not a valid PreToolUse decision (allow | deny | ask). Claude Code rejects the hook output and aborts the AskUserQuestion call itself, so with the hook active every question fails with "Tool execution was interrupted" while the hook exits 0 and logs nothing. A hook with no opinion now emits nothing on pass-through. A contract test pins the behavior: pass-through, non-target tools, and malformed stdin stay silent, and every emitted decision uses a valid value. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
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.
Problem
The pass-through path in
hosts/claude/hooks/question-preference-hook.tsreturnspermissionDecision: 'defer'.deferis not a valid PreToolUse decision (allow | deny | ask), so Claude Code rejects the hook output and aborts the AskUserQuestion call itself. With the hook active, every question fails with "Stopped — Tool execution was interrupted", while the hook exits 0 and logs nothing — the failure presents as a harness bug rather than a hook bug. Introduced in v1.60.1.0; still present on main.Fix
A hook with no opinion emits nothing: pass-through now exits silently instead of inventing a decision value. The Conductor transport-avoidance
denypath is unchanged.Test
test/question-preference-hook-contract.test.tspins the output contract mechanically: pass-through, non-target tools, and malformed stdin are silent with exit 0, and any emitted decision must come from the valid set. Hermetic via a tempGSTACK_STATE_ROOT.bun test test/question-preference-hook-contract.test.ts— 6 pass.🤖 Generated with Claude Code