fix(server): Claude asks before commands in Auto-accept edits - #13786
juliusmarminge merged 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The production adapter changes command and tool authorization behavior in Claude’s Auto-accept edits mode, with a focused regression test covering the intended prompt flow. Because this is security-sensitive command-permission logic, human review is warranted. You can add or adjust custom eligibility rules. Learn more. |
3ec7df1
into
t3code/codex-turn-mapping
On V2, a Claude thread in Auto-accept edits never asks about anything. Commands and other non-edit tools run without approval, the same as Full access. The permission modes guide says Auto-accept edits "approves file edits automatically; other actions can still require approval".
I saw this with a Claude Sonnet 5 thread that I switched to Auto-accept edits.
node -e "console.log(7*6)"andrm -f auto.txtboth ran, andorchestration_v2_projection_runtime_requestshad no new rows. The provider log shows the query opened withpermissionMode: "acceptEdits"and acanUseToolcallback.Cause
Claude's
acceptEditsmode approves edits on its own and sends every other tool throughcanUseTool. The adapter's callback decides whether to ask withrequiresClaudeApproval, which readsinstallPermissionCallback. That flag wastrueonly forapproval-required. Inauto-accept-edits, the callback therefore answeredallowfor every tool without raising a request. The V1 Claude adapter asked in every mode except Full access.Fix
Set
installPermissionCallbackforauto-accept-editsas well. Edits still pass without a prompt because Claude approves them before the callback runs. Commands and other tools now raise a normal approval request. Supervised, Auto, and Full access are unchanged, and so are explicitapprovalPolicyoverrides.Verification
ClaudeAdapterV2 Auto-accept edits › asks before a command instead of allowing it. It opens a session in Auto-accept edits, calls the adapter'scanUseToolfor aBashcommand, and checks that acommandruntime request comes before any decision. Approving the request then allows the command.the command ran without asking: expected 'decision' to equal 'request'.vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts: 119/119 pass.vp test run src/orchestration-v2/testkit/ClaudeReplayFixtures.integration.test.ts: 3/3 pass.vp test run src/orchestration-v2/testkit/OrchestratorReplayFixtures.integration.test.ts -t claude: 26 pass.vp exec tsc --noEmit -p .in apps/server: noerror TSorwarning TS.vp linton the touched files: no new findings. The existingno-unused-varswarning onlayeris on the base too.knip --workspace apps/server --exports: clean.Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code