Repository navigation
fix(server): Full access rejects Claude Code's reworded dangerous-removal check - #38581
Conversation
…moval check Reproduces #38572: Claude Code 2.1.327's unparsed-line removal check can say "Claude Code can't be sure it read this command the way the shell will, so it can't rule out a dangerous removal", which the bypass-mode reject does not match, so the turn waits on an approval card. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…oval check Claude Code 2.1.327 words its unparsed-command removal check as "...can't rule out a dangerous removal..." when no rm is visible, which the bypass-mode reject did not recognise, so Full access turns stopped on an approval card. Match "dangerous removal" in the reason as well. Fixes #38572 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: 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. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
No changes were needed in this round. The brief listed no items to address, and on the open PR #38581 all 38 checks passed at 7edfff0. CodeRabbit's review generated no actionable comments, and there are no comments on lines. The only other comment, the thread-transfer report, is within every enforced limit. The fix is unchanged: canUseToolEffect in ClaudeAdapterV2.ts now also treats a reason matching /\bdangerous removal\b/i as a removal check in bypassPermissions, so Claude Code 2.1.327's reworded unparsed-line check is denied automatically, with Claude's warning passed to the agent. The regex has a fixed literal between two word boundaries and no quantifiers, so it runs in linear time on any input. The watch on the PR has been removed.
Fixes #38572
Reproduction on main
Commit 6a29d58 (origin/main). Claude Code 2.1.327 is installed on the VM; its binary contains the new reason text, three removal checks are tagged circuitBreaker:"dangerousRemoval", and its source picks the new wording when a command fails to parse and no rm is visible (it uses the old 'Dangerous rm operation not ruled out' wording when rm is seen). (1) Probe with the SDK on main (0.3.321) in bypassPermissions with canUseTool:
echo ${(%):-x}; rm -rf ./junkgave the old wording, whileecho ${(%):-x}andecho ${(%):-x}; find ./junk -deleteboth reached canUseTool with decisionReason "Claude Code can't be sure it read this command the way the shell will, so it can't rule out a dangerous removal. Read the command, and don't go ahead if you can't tell what it does." (2) In the app: ranT3CODE_DEV_SEED=0 vp run devin a fresh worktree, paired the web client, picked a new thread with Claude Haiku 5.5 in Permissions: Full access (the default), and sent "Run exactly this Bash command once, verbatim, with no changes, then stop: echo ${(%):-x}". The thread showed the Bash item with that reason and 'Waiting for approval · Decline · Approve', the sidebar showed 'Approval', and the turn stayed blocked until I declined. Expected per docs: an automatic deny with Claude's warning. (3) Added one row with the new reason to the existing safety-check table in ClaudeAdapterV2.test.ts ('resolves and cancels the SDK resume dialog through structured runtime input');vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts -t "resolves and cancels the SDK resume dialog"fails on main withexpected 'approval' to equal 'decision'.Evidence
Real Claude Code 2.1.327, Claude Haiku 5.5, Full access; Linux Chromium 157, 1280×800, dark theme, fresh synthetic state on each commit.
In a new thread, submit exactly:
Run exactly this Bash command once, verbatim, with no changes, then stop: echo ${(%):-x}. Leave approvals unanswered. Base waits for a person; head automatically denies execution, preserves Claude's warning, and completes without intervention.Stills show matching conversation crops below the elapsed-time counter; recordings show the full viewport and submission through outcome. Browser driver · Reproduction setup.
Not shown:
Tests
No new local runs this round. Earlier on this head: the repro test fails without the fix and passes with it; ClaudeAdapterV2.test.ts passed 467/467; vp run check:changed passed. In CI on 7edfff0 all 38 checks passed.
Not in this change
echo ${(%):-x}), so for those the deny message's 'continue the rest of the task without the removal' advice is slightly inaccurate; rewording the deny message was left alone.Who did the work
Run by the t3code factory in T3 Code.