Skip to content

fix(server): Claude Auto asks before commands Claude escalates - #40692

Open
juliusmarminge wants to merge 2 commits into
mainfrom
factory/issue-15353-a35207
Open

juliusmarminge wants to merge 2 commits into
mainfrom
factory/issue-15353-a35207

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

In Auto mode, when Claude decided a tool call needed a person's approval (a permissions.ask rule, a PreToolUse hook returning ask, or the classifier's fallback after repeated blocks), T3 Code approved it immediately without prompting, and Claude's transcript recorded it as a user approval. Auto now treats these escalated requests the same way Full access already does: T3 Code shows an approval request and waits for the user.

Fixes #15353

Reproduction on main

Commit f9b19a7 (origin/main). Scratch git repo whose origin is a local bare repo, with one unpushed commit; project .claude/settings.json = {"permissions":{"ask":["Bash(git push:*)"]}}. Isolated dev server (T3CODE_DEV_SEED=0 vp run dev) with defaultRuntimeMode "auto" in the worktree's settings; project added with t3 project add, thread started with t3 thread start --provider claudeAgent --model claude-haiku-5-5 asking it to run git push origin main once. Observed in the web client: the thread completed and showed only the push output (ca35990..c0c91d7 main -> main); no approval request appeared, and the bare remote received the commit. The stored thread has runtimeMode "auto"; Claude's session transcript shows permissionMode "auto" and the Bash tool_result records permissionDecision {"decision":"accept","source":"user_temporary","ruleSource":"projectSettings","reasonCode":"rule:projectSettings"}, i.e. Claude matched the ask rule, forwarded it to canUseTool, and T3 auto-allowed it as if the user approved. Adapter test on branch factory/repro-15353: the auto case fails with 'the command ran without asking: expected decision to equal request'; the auto-accept-edits control passes.

Evidence

Being captured: before and after in the real app. This section is filled in before the pull request can merge.

Tests

  • vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts (apps/server): 475 passed
  • vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts -t escalates on base without the fix: auto case fails as reported, auto-accept-edits control passes
  • vp run check:changed: format, lint, knip, typecheck (3 packages), tests (2 files, 477) all pass

Not in this change

  • Neither Auto nor Full access respects an explicit approvalPolicy "never" for Claude-escalated requests; I left that unchanged to match the existing Full access behaviour.
  • Did not check the v1 Claude adapter for the same behaviour; the issue is about orchestrator v2.

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 22, 2026 05:39
Repro for #15353. In Auto, the Claude adapter's canUseTool answers allow
for requests Claude forwards for a person's decision (ask rules, ask hooks,
classifier fallback). Auto-accept edits is the passing control.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In Auto, Claude forwards requests it wants a person to decide (ask rules,
ask hooks, classifier fallback) to canUseTool, but the v2 adapter answered
allow without prompting. Treat Auto like Full access: forwarded requests
now become approval requests.

Fixes #15353

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

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: 0fb6ac6 · PR result: 52ecae9 · 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 22, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Claude adapter now requires approval for requests escalated in Auto mode. The updated test covers both Auto and Auto-accept-edits modes and verifies that accepting an approval request allows the tool call.

Changes: Claude permission approvals

Layer / File(s) Summary
Require approval for escalated requests
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts, apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
requiresClaudeApproval now returns true for Auto mode. Parameterized tests verify that escalated Bash requests wait for runtime approval in Auto and Auto-accept-edits modes, and that accepting the request returns an allow decision.

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

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: yash-singh1, macroscopeapp, rishabhx29

Merge Risk: Minimal · up to 52eca

In Auto mode, Claude requests that are escalated for human review, such as permissions.ask matches, ask hooks and classifier fallback, now show an approval request instead of running without a prompt. The change is a small, targeted predicate update, and its test covers the new behavior and the existing control mode. No remaining merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: in Claude Auto mode on orchestrator v2, commands that Claude escalates now prompt for approval instead of running without asking. It uses the conventional commit forma…
Description check Passed The description follows the repository template. It explains the problem (Auto mode auto-approved escalated requests), the change (escalated requests now prompt like Full access), the scope (links iss…
Linked Issues check Passed Issue #15353 requires that Claude Auto mode on orchestrator v2 show an approval request when Claude escalates a command, including an ask-rule match. The reviewed head changes ClaudeAdapterV2.ts so th…
Out of Scope Changes check Passed The two changed files are ClaudeAdapterV2.ts and ClaudeAdapterV2.test.ts, both in apps/server/src/orchestration-v2/Adapters. The adapter change alters only the approval predicate for Auto mode. The te…
Full details: Title check

Explanation

The title names the main change: in Claude Auto mode on orchestrator v2, commands that Claude escalates now prompt for approval instead of running without asking. It uses the conventional commit format and matches the summarized change in ClaudeAdapterV2.ts and its test.

Full details: Description check

Explanation

The description follows the repository template. It explains the problem (Auto mode auto-approved escalated requests), the change (escalated requests now prompt like Full access), the scope (links issue #15353 and gives a reproduction), and verification (specific test commands with results). It also names the model and harness that did the work. The Evidence section is still a placeholder, and the template asks for before/after evidence for UI changes. This change is a server-side behavior fix, so the placeholder is a remaining gap rather than a failure. The Verification section does not state what could not be checked in the real app.

Resolution

Fill in the Evidence section with the before and after results from the real app, or state why it cannot be captured before merge. Note any checks that were not run.

Full details: Linked Issues check

Explanation

Issue #15353 requires that Claude Auto mode on orchestrator v2 show an approval request when Claude escalates a command, including an ask-rule match. The reviewed head changes ClaudeAdapterV2.ts so that requiresClaudeApproval is true when the query policy installs a permission callback or uses auto or bypassPermissions. Before the change, only bypassPermissions required approval, so Auto callbacks returned allow without prompting. The updated test in ClaudeAdapterV2.test.ts runs both auto-accept-edits and auto. For each, it invokes the captured canUseTool callback with a Bash command and checks that a runtime approval request arrives before the callback resolves. Accepting that request must return allow. This covers the reported behavior. The author reports 475 passing adapter tests and a failing auto case on the base revision. I did not re-run these tests. The PR's explicit exclusions (approvalPolicy never, v1 adapter) are not coding requirements of #15353.

Full details: Out of Scope Changes check

Explanation

The two changed files are ClaudeAdapterV2.ts and ClaudeAdapterV2.test.ts, both in apps/server/src/orchestration-v2/Adapters. The adapter change alters only the approval predicate for Auto mode. The test change generalizes the existing escalation test to cover auto. Both changes implement #15353. The PR does not change v1 adapter code or approvalPolicy handling, and it discloses these as excluded. I could not read the full ClaudeAdapterV2.ts diff because the changed blobs were unavailable in the checkout. The assessment relies on the supplied PR summary and the file-level summary for the predicate change, so there is minor uncertainty about unrelated hunks.

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 0fb6ac6 and 52ecae9.

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; 8 remain after this review.

@juliusmarminge

Copy link
Copy Markdown
Member Author

The automated pipeline stopped on this pull request and will not merge it:

the fix is written and reviewed, but proving it needs something no worker has:

  • Permanent blocker: the reproduction requires first-party Claude access capable of running claude-haiku-5-5 in Auto mode and forwarding permissions.ask escalations. The VM brief lists first-party Claude access as unavailable and instructs against workarounds. Replay cannot exercise this provider-specific path, so ask-rule, hook, and classifier-fallback behavior remain unverified.

It stays open for a person to finish or close.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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]: Claude Auto mode on orchestrator v2 runs ask-rule commands without prompting

1 participant