Skip to content

fix(server): Full access rejects Claude Code's reworded dangerous-removal check - #38581

Merged
juliusmarminge merged 3 commits into
mainfrom
factory/issue-38572
Nov 19, 2026
Merged

juliusmarminge merged 3 commits into
mainfrom
factory/issue-38572

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

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 ./junk gave the old wording, while echo ${(%):-x} and echo ${(%):-x}; find ./junk -delete both 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: ran T3CODE_DEV_SEED=0 vp run dev in 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 with expected '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.

Before After
6a29d58d14 7edfff018d
Before: waiting for approval After: automatic denial preserves Claude's warning
Before recording After recording

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:

  • Base's animated running indicator prevented pixel-identical still captures 500 ms apart; the full recording is the primary evidence for the blocked turn.

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

  • The new 'dangerous removal' wording also fires for commands that delete nothing (e.g. 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

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

juliusmarminge and others added 2 commits November 18, 2026 11:40
…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]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 10.5 KiB 10.5 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.4 KiB 92.4 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 186.2 KiB 186.2 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 10.6 KiB 10.6 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.2 KiB 384.2 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 188.1 KiB 188.1 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: 1d39325 · PR result: f77395b · Source CI: success

Scenario and decoded snapshot size

10 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.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This change extends Claude dangerous-removal reason matching in bypass-permission mode and adds a regression test for the new reason text when no ask rule is matched.

Changes: Claude dangerous-removal bypass handling

Layer / File(s) Summary
Reason match and regression coverage
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts, apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
The bypass-permission removal-safety check now also matches decision reasons that contain dangerous removal. The existing denial path still applies when no ask rule is matched. A test case covers Claude Code’s shell-parsing uncertainty wording in the resume-compaction safety scenarios.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • pingdotgg/t3code#32317: This PR changes the same ClaudeAdapterV2.ts dangerous-removal handling in Full access and relies on the dangerous-removal reject path as an exception.

Suggested reviewers: yash-singh1, macroscopeapp

Merge Risk: Minimal · up to 7edff

This change makes Full access automatically deny Claude Code's reworded dangerous-removal safety check, so unattended turns no longer stall on an approval card. The change is small and covered by a regression test. No merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Full access (bypassPermissions) now denies Claude Code's reworded dangerous-removal check. It matches the adapter change that adds a reason-text match for "dangerous r…
Linked Issues check Passed Directly linked issue #38572 requires Full access to reject Claude Code 2.1.327's reworded dangerous-removal check ("...can't rule out a dangerous removal...") with Claude's warning, instead of showin…
Out of Scope Changes check Passed The change set consists of a one-line regex alternative in the removal-check condition of ClaudeAdapterV2.ts and one test row in ClaudeAdapterV2.test.ts. Both directly implement issue #38572. The PR d…
Description check Passed The description is mostly complete and substantive. It has a clear problem statement tied to issue #38572 (Claude Code 2.1.327 reworded dangerous-removal check falls through to an approval card in Ful…
Full details: Title check

Explanation

The title names the main change: Full access (bypassPermissions) now denies Claude Code's reworded dangerous-removal check. It matches the adapter change that adds a reason-text match for "dangerous removal" and the regression test row. The title is a conventional commit with a plain-language summary and no file list.

Full details: Linked Issues check

Explanation

Directly linked issue #38572 requires Full access to reject Claude Code 2.1.327's reworded dangerous-removal check ("...can't rule out a dangerous removal...") with Claude's warning, instead of showing an approval card. The reviewed change adds \bdangerous removal\b (case-insensitive) to the existing removal-check condition in canUseToolEffect in apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts. This matches the issue's suggested fix. The guards (Bash only, bypassPermissions only, no matched ask rule) are unchanged. ClaudeAdapterV2.test.ts gains one row with the new reason text in the existing safety-check table, which covers the reported behavior. Evidence limits: the repository diff tool could not read the changed blobs, so the code change is confirmed only from the supplied raw summary and PR description, not from the diff itself. The reported test results (repro test fails without the fix, 467/467 file tests pass) are author claims that I did not rerun. The issue's non-coding items (Evidence capture) do not apply.

Full details: Out of Scope Changes check

Explanation

The change set consists of a one-line regex alternative in the removal-check condition of ClaudeAdapterV2.ts and one test row in ClaudeAdapterV2.test.ts. Both directly implement issue #38572. The PR description and PR objectives state that rewording the deny message is excluded and was not changed. No unrelated files or behavior changes appear in the supplied summaries. The diff tool could not read the changed blobs, so this verdict relies on the supplied summary (+1/-0 and +5/-0 line counts) rather than a full diff read.

Full details: Description check

Explanation

The description is mostly complete and substantive. It has a clear problem statement tied to issue #38572 (Claude Code 2.1.327 reworded dangerous-removal check falls through to an approval card in Full access). It describes the change (a reason-text match in canUseToolEffect for bypassPermissions) and the scope, linking the issue. Verification is detailed: a reproduction on main, a failing-then-passing targeted test, a 467/467 test run, and before/after evidence with screenshots and recordings. It also states what was not checked (no new local runs this round) and attributes the authorship. The template's comment-style guidance is followed in spirit, though the Change section is brief and the Scope section cites a linked issue rather than a maintainer request. The template's conventional commit title guidance is not addressed in the body, and the description opens with a note about 'no changes this round' that is not part of the template. These are minor gaps.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 759a173 and 7edfff0.

Files selected for processing: 2

  • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
  • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@juliusmarminge
juliusmarminge merged commit 554be2c into main Nov 19, 2026
0 checks passed
@juliusmarminge
juliusmarminge deleted the factory/issue-38572 branch November 19, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Full access stops on Claude Code 2.1.327's reworded dangerous-removal check

1 participant