fix(server): agents no longer start threads in plan mode #27829
Problem#
With Plan mode (legacy) off (the default), an agent could still start threads in plan mode by passing interactionMode: "plan" to t3_thread_launch, delegate_task or create_threads. The child ran in plan mode (for Claude, permissionMode: "plan" from its first turn) while the UI hid the mode toggle, so the user could not see that mode or stop the first plan-mode turn.
Reproduced on main 3bd744fc11 in the web dev app with a fresh database. A Claude Sonnet 5.5 thread in full-access/default mode was asked to launch a thread and delegate a subagent, each with interactionMode: "plan". Both children were stored with interaction_mode = plan (createdBy: agent, creationSource: mcp).
Change#
The three agent-facing inputs no longer take interactionMode. A child always runs in its caller's interaction mode:
t3_thread_launchgets it from the caller's limits (McpToolAccess.startsThreads).delegate_taskandcreate_threadsuse the parent thread's mode (OrchestratorMcpService).- Remote delegation (
RemoteDelegation) stops forwarding an explicit mode. The linked side already inherits the parent's mode through theT3-Mode-Limitheader.
planModeEnabled is a client-only setting, so the server cannot tell whether the user can see plan mode. Inheriting is the only safe rule: a plan-mode parent still gets plan-mode children. The unused OrchestratorMcpInteractionMode contract is removed. runtimeMode handling is unchanged. The t3_thread_launch description and the orchestrator MCP internals doc are updated to match.
Scope and approval#
Fixes pingdotgg/t3code#27819
Triaged via the automated issue flow.
Verification#
Focused tests:
apps/server/src/mcp/toolkits/project/handlers.test.ts, "a launch from a default-mode caller starts in default mode even when plan is asked": fails on main withexpected 'plan' to be 'default', passes here.apps/server/src/mcp/OrchestratorMcpService.test.ts, "children of a default-mode thread start in default mode even when plan is asked": coversdelegate_taskandcreate_threads. Fails on main with both dispatched commands carryinginteractionMode: "plan", passes here.- Existing tests that exercised the removed argument were updated:
McpToolAccess.test.ts,McpHttpServer.test.ts(aninteractionModekey a client still sends is now dropped, and theT3-Mode-Limitcap still applies),PeerForwarding.test.ts, andpackages/contracts/src/orchestratorMcp.test.ts. vp run check:changedon the merged head: format, lint, knip, graphql, typecheck (35 packages) and tests (10 files, 183 tests) all pass.
Runtime transcript: the web dev app, fresh database each side (T3CODE_DEV_SEED=0), Plan mode (legacy) off, Claude Sonnet 5.5 parent in full-access/default mode, with the same prompt asking for interactionMode: "plan" on t3_thread_launch and delegate_task:
| Child | Before (3bd744fc11) | After (697830795f) |
|---|---|---|
t3_thread_launch "Plan README improvement" | interaction_mode=plan, Claude permissionMode: "plan" | interaction_mode=default, Claude permissionMode: "bypassPermissions" |
delegate_task "Plan a small refactor" | interaction_mode=plan | interaction_mode=default, Claude permissionMode: "bypassPermissions" |
After the fix, the agent noted the schemas no longer list interactionMode, sent it anyway, and got no error; the server ignored it.
Not checked:
create_threadsin the running app; the unit test above covers it.- A mixed-version linked environment; covered by reading the code only.
There is no visible UI change, so there are no captures.
Model and harness: Claude Opus 5.5 (lead, red test, implementation, review B) and GPT-6.1-Sol (review A), driven through Claude Code and Codex in T3 Code.
🤖 Generated with Claude Code
- 1
- 2
Pusheda69563e
Sign in to join this conversation.