Skip to content

Fix AskUserQuestion pass-through emitting an invalid permission decision - #2373

Open
ilanbm wants to merge 1 commit into
garrytan:mainfrom
ilanbm:fix/question-hook-valid-permission-decision
Open

Fix AskUserQuestion pass-through emitting an invalid permission decision#2373
ilanbm wants to merge 1 commit into
garrytan:mainfrom
ilanbm:fix/question-hook-valid-permission-decision

Conversation

@ilanbm

@ilanbm ilanbm commented Jul 28, 2026

Copy link
Copy Markdown

Problem

The pass-through path in hosts/claude/hooks/question-preference-hook.ts returns permissionDecision: 'defer'. defer is 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 deny path is unchanged.

Test

test/question-preference-hook-contract.test.ts pins 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 temp GSTACK_STATE_ROOT. bun test test/question-preference-hook-contract.test.ts — 6 pass.

🤖 Generated with Claude Code

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>
@trunk-io

trunk-io Bot commented Jul 28, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

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