Repository navigation
fix(server): environment refusals to an MCP client name its approved access - #40159
juliusmarminge wants to merge 2 commits into
Conversation
… its access Fails on main: the refusal says a full-access calling thread is needed, though the caller is an MCP client approved with Auto access (#37521). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…access 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:
|
When an agent used an MCP client approved below Full access (for example a T3 Connect server in Claude's own MCP settings, approved with Auto) to change projects or environment settings, the refusal said a full-access calling thread was needed. Agents read that as "I'm no longer inside a T3 chat" and stopped. The refusal now names the client and the access it was approved with, and says how to get Full access. Refusals to thread callers keep the existing text.
Fixes #37521
Reproduction on main
Commit aa6fe39 (origin/main). Ran
T3CODE_DEV_SEED=0 vp run devin a fresh worktree, added a scratch git project witht3 project add, and started a Claude Haiku thread witht3 thread start --provider claudeAgent --model claude-haiku-5-5(a new thread defaults to full access). The agent's call tomcp__t3-code__t3_project_createsucceeded. I stopped the dev server and started it again, then usedt3 thread sendon the same thread for another t3_project_create. It succeeded again throughmcp__t3-code__, so the built-in thread credential survives a restart. Next I followed the reporter's actual setup: theirclaude mcp listshows a second T3 server,t3, on the T3 Connect relay, approved with Auto. T3 does not pass strictMcpConfig to Claude thread sessions (only the capabilities probe does), so Claude loads that server besidet3-code. Against the same dev server, a script registered an MCP client at /oauth/mcp/register, approved it with accessautousing a pairing code (/oauth/mcp/decision), exchanged the code with PKCE (scope orchestration:read orchestration:operate), and sent tools/call t3_project_create to /mcp. It got capability_denied with the reporter's exact text: "Changing projects or environment settings needs a live full-access/default calling thread or a full-access client." The failing test on factory/repro-37521 asserts that a refusal to an Auto-approved client names that access and does not mention a calling thread. It fails on main.Evidence
Register an external MCP client, approve with Auto, exchange the authorization code with PKCE, and call
t3_project_create. Restart the real server with the same database and repeat using the same OAuth token. Both sides used fresh isolated Linux server state over loopback HTTP.The same result occurred before and after restart. Auto remains correctly refused; this proves the diagnostic correction, not expanded permissions.
Reproduction driver
Not shown:
Tests
vp test run src/mcp/McpToolAccess.test.ts -t "names that access"without the fix: 1 failed (the repro test)vp test run src/mcp/McpToolAccess.test.ts src/mcp/threadAccess.test.ts src/mcp/linkOrigin.test.tswith the fix: 80 passedvp test run src/mcp/McpHttpServer.test.ts: 43 passedvp run check:changed: format, lint, knip, typecheck and tests all passedNot in this change
Who did the work
Run by the t3code factory in T3 Code.