Skip to content

Commit 83da712

Browse files
Aaron Zingerleclaude
andcommitted
fix(server): Claude Plan mode runs t3_background_wait without asking
Claude Plan mode blocks every MCP tool that does not declare readOnlyHint, and allow rules, session approvals included, do not lift that. Every t3_background_wait call in Plan therefore waited on an approval card. The tool only records which background tasks keep the thread Working, so annotate it read-only like t3_thread_wait. Fixes #32022 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f3da8ff commit 83da712

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎apps/server/src/mcp/toolkits/orchestrator/tools.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ const BackgroundWaitTool = Tool.make("t3_background_wait", {
154154
failure: OrchestratorMcpFailure,
155155
failureMode: "return",
156156
dependencies,
157-
}).annotate(Tool.Title, "Wait on background work");
157+
})
158+
.annotate(Tool.Title, "Wait on background work")
159+
// Only marks which tasks keep the thread Working; Claude Plan mode blocks tools without this.
160+
.annotate(Tool.Readonly, true)
161+
.annotate(Tool.Destructive, false);
158162

159163
const ScheduleTaskTool = Tool.make("schedule_task", {
160164
description:

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,8 @@ describe("ClaudeAdapterV2 MCP query overrides", () => {
610610
.map((tool) => `mcp__t3-code__${tool.name}`)
611611
.sort();
612612

613+
// regression: #32022 Claude Plan mode asks before every non-read-only MCP call
614+
assert.include(readOnlyToolNames, "mcp__t3-code__t3_background_wait");
613615
assert.deepEqual(
614616
[...ClaudeAdapterV2.CLAUDE_READ_ONLY_T3_MCP_ALLOWED_TOOLS].sort(),
615617
readOnlyToolNames,

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,7 @@ export const CLAUDE_T3_MCP_TOOL_WILDCARD = "mcp__t3-code__*";
19951995
export const CLAUDE_READ_ONLY_T3_MCP_ALLOWED_TOOLS: ReadonlyArray<string> = [
19961996
"mcp__t3-code__orchestrator_capabilities",
19971997
"mcp__t3-code__list_scheduled_tasks",
1998+
"mcp__t3-code__t3_background_wait",
19981999
"mcp__t3-code__t3_thread_list",
19992000
"mcp__t3-code__t3_thread_wait",
20002001
"mcp__t3-code__t3_worktree_status",

0 commit comments

Comments
 (0)