fix(unified): serialize Claude bare Allow to PassThrough - #19
Merged
Conversation
The unified OnBeforeExecution bridge mapped a bare AllowExecution() (no
reason) to claude.AllowSilent(), which emits permissionDecision: "allow".
On Claude that silently auto-approves the tool call and bypasses Claude's
own permission prompts (COR-8956). Return claude.PassThrough() (empty {})
instead so the normal permission flow proceeds.
Adds a bridge test asserting a Claude Allow serializes to {} with no
permissionDecision or suppressOutput, and documents the behavior in the
unified reference.
Co-authored-by: Lahari Gandrapu <laharigandrapu11@gmail.com>
laharigandrapu11
marked this pull request as ready for review
July 24, 2026 14:25
tanuj-corridor
approved these changes
Jul 24, 2026
Contributor
|
Note: Worth extending PR / making a followup to mirror changes for factory w/ |
…nput Cursor does not enforce permission "ask" — a headless session executes it silently — so an Ask decision on cursor-before-shell and cursor-before-mcp was a silent fail-open. Both now deny, matching the Codex handler, which makes the behavior the reference doc already describes. An empty tool_input built a zero-length json.RawMessage. Marshaling a context carrying one fails with "unexpected end of JSON input"; leaving it nil marshals as null instead. Tests cover both, and fail against the previous behavior. Also drops two tracker references from comments.
jake-corridor
self-requested a review
August 3, 2026 18:52
jake-corridor
approved these changes
Aug 3, 2026
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
The unified
OnBeforeExecutionbridge previously mapped a bareAllowExecution()(no reason) on Claude toclaude.AllowSilent(), which emitspermissionDecision: "allow". On Claude that silently auto-approves the tool call and bypasses Claude's own permission prompts, which is not the intended behavior for a bare Allow.This change makes a bare Allow serialize to an empty
{}pass-through so Claude's normal permission flow proceeds. An Allow with a reason is unchanged and still emits an explicitclaude.Allow(reason)auto-approval.Changes
unified.go: in the Claude branch ofOnBeforeExecution, a bare Allow now returnsclaude.PassThrough()(empty{}) instead ofclaude.AllowSilent(). An Allow with a reason still returnsclaude.Allow(reason).unified_test.go: addsTestClaudePreToolUse_AllowSerializesToEmpty, asserting a bare Claude Allow serializes to{}with nopermissionDecisionand nosuppressOutput.docs/reference-unified.md: documents the Claude bare-Allow to pass-through behavior.Testing
go build ./...andgo test ./...both pass.