Repository navigation
fix(server): Claude Auto asks before commands Claude escalates - #40692
juliusmarminge wants to merge 2 commits into
Conversation
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>
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:
|
|
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:
It stays open for a person to finish or close. |
In Auto mode, when Claude decided a tool call needed a person's approval (a
permissions.askrule, a PreToolUse hook returningask, 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 witht3 thread start --provider claudeAgent --model claude-haiku-5-5asking it to rungit push origin mainonce. 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: theautocase fails with 'the command ran without asking: expected decision to equal request'; theauto-accept-editscontrol 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 passedvp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts -t escalateson base without the fix:autocase fails as reported,auto-accept-editscontrol passesvp run check:changed: format, lint, knip, typecheck (3 packages), tests (2 files, 477) all passNot in this change
Who did the work
Run by the t3code factory in T3 Code.