Skip to content

fix(unified): serialize Claude bare Allow to PassThrough - #19

Merged
jake-corridor merged 3 commits into
mainfrom
cursor/fix-claude-allow-passthrough-02e1
Aug 3, 2026
Merged

fix(unified): serialize Claude bare Allow to PassThrough#19
jake-corridor merged 3 commits into
mainfrom
cursor/fix-claude-allow-passthrough-02e1

Conversation

@laharigandrapu11

@laharigandrapu11 laharigandrapu11 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

The unified OnBeforeExecution bridge previously mapped a bare AllowExecution() (no reason) on Claude to claude.AllowSilent(), which emits permissionDecision: "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 explicit claude.Allow(reason) auto-approval.

Changes

  • unified.go: in the Claude branch of OnBeforeExecution, a bare Allow now returns claude.PassThrough() (empty {}) instead of claude.AllowSilent(). An Allow with a reason still returns claude.Allow(reason).
  • unified_test.go: adds TestClaudePreToolUse_AllowSerializesToEmpty, asserting a bare Claude Allow serializes to {} with no permissionDecision and no suppressOutput.
  • docs/reference-unified.md: documents the Claude bare-Allow to pass-through behavior.

Testing

go build ./... and go test ./... both pass.

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
laharigandrapu11 marked this pull request as ready for review July 24, 2026 14:25
@tanuj-corridor

Copy link
Copy Markdown
Contributor

Note: Worth extending PR / making a followup to mirror changes for factory w/ droid.AllowSilent() → droid.PassThrough()

@claude claude Bot changed the title fix(unified): serialize Claude bare Allow to PassThrough (COR-8957) fix(unified): serialize Claude bare Allow to PassThrough Jul 28, 2026

@jake-corridor jake-corridor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Withdrawn pending internal review.

Comment thread docs/reference-unified.md Outdated
Comment thread unified.go
…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
jake-corridor self-requested a review August 3, 2026 18:52
@jake-corridor
jake-corridor merged commit 4cccbbf into main Aug 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants