Repository navigation
fix(claude): Plan mode asks before writes in Auto and Full access - #17963
maxwellyoung wants to merge 2 commits into
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes production Claude permission enforcement for Plan-mode file edits and shell commands, including whether those operations are allowed to execute. The implementation is tightly scoped and well tested, but the authorization-sensitive runtime impact warrants human review. You can add or adjust custom eligibility rules. Learn more. |
0cff6e7 to
d518b40
Compare
Dismissing prior approval to re-evaluate b2fa07b
|
@coderabbitai Thanks for raising pending approvals on interruption. I checked the path: b2fa07b adds regressions for that case: Auto and Full access, Edit and Bash, abort while the approval is pending. Each one gets a deny, the late accept is rejected, and the file is unchanged. Adapter suite: 217/217 with the fix. The original adapter fails 16, the 4 new cases among them, because it allows the write without asking. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
fd -t f '^ClaudeAdapterV2(\.test)?\.ts$'
ast-grep outline apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts --items all --match 'awaitClaudeApprovalDecision|respondToRuntimeRequest|canUseToolEffect' --view expanded
ast-grep outline apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts --items all --match 'plan|Plan|abort|Abort' --view expanded
rg -n -C 18 'awaitClaudeApprovalDecision|No pending Claude runtime request|pendingRuntimeRequests\.delete' apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
rg -n -C 30 'late accept|abort while|abort.*pending|pending.*abort|file is unchanged|controller\.abort|abortController\.abort' apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsLength of output: 11463
The four new cases cover Auto and Full access with both The existing cancellation path already handles my concern. I withdraw the finding. ✏️ Learnings added
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! You are interacting with an AI system. |
Problem
In Auto or Full access with Plan mode on, Claude's native plan mode routes file edits and file-modifying shell commands to T3's
canUseToolcallback. That callback only raises approvals for Supervised and Auto-accept edits, so for Auto and Full access it answersallowand the write goes through with no prompt. Reported and confirmed in #15503.Change
approvalPolicy: never, the callback denies the request instead of silently allowing the write.Read-only tools Claude approves before the callback,
ExitPlanModeproposed-plan capture, and Full access outside Plan keep their current behavior.Scope and approval
Fixes #15503. This follows the fix area in the maintainer triage (#15503 (comment)): treat edit and shell-write callback requests in Auto + Plan and Full access + Plan the way Supervised and Auto-accept edits already do. It does not change default Auto escalation (#15360). Backend only, two files.
Verification
cd apps/server && vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsvp checkon both files: 0 errors, 1 warning on an unchangedlayerdeclaration.vp run --filter t3 typecheckpasses.Prepared with gpt-6.1-sol through Codex, rebased and verified with Claude Opus 5.5 through Claude Code in T3 Code.
🤖 Generated with Claude Code