From 411e9b4342b6f44cf77352108223a0d73a574b09 Mon Sep 17 00:00:00 2001 From: Phon Date: Thu, 12 Nov 2026 13:27:53 +0530 Subject: [PATCH 1/5] fix(server): schedule_task no longer tells agents bindToCurrentThread always defaults to true --- .../src/mcp/toolkits/orchestrator/tools.test.ts | 11 +++++++++++ apps/server/src/provider/agentContextBudget.json | 2 +- packages/contracts/src/orchestratorMcp.ts | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/server/src/mcp/toolkits/orchestrator/tools.test.ts b/apps/server/src/mcp/toolkits/orchestrator/tools.test.ts index ea0caa4ce166a..ca20390d3bde1 100644 --- a/apps/server/src/mcp/toolkits/orchestrator/tools.test.ts +++ b/apps/server/src/mcp/toolkits/orchestrator/tools.test.ts @@ -17,6 +17,17 @@ it("states t3_thread_read page size limits in the parameter descriptions", () => } }); +// The server binds an omitted bindToCurrentThread only in the caller's own project; +// the schema description is the only place a model sees that default. +it("states the conditional bindToCurrentThread default in the schedule_task schema", () => { + const schema = Tool.getJsonSchema(OrchestratorToolkit.tools.schedule_task) as { + readonly properties: Readonly>; + }; + const serialized = JSON.stringify(schema.properties.bindToCurrentThread); + expect(serialized).toContain("this thread's own project"); + expect(serialized).not.toContain("Default true: runs post in this thread."); +}); + it("refuses a t3_thread_update whose fields do not fit its action", () => { const decode = Schema.decodeUnknownExit( OrchestratorToolkit.tools.t3_thread_update.parametersSchema, diff --git a/apps/server/src/provider/agentContextBudget.json b/apps/server/src/provider/agentContextBudget.json index 486c4314927ad..d458e1c4fbbe4 100644 --- a/apps/server/src/provider/agentContextBudget.json +++ b/apps/server/src/provider/agentContextBudget.json @@ -1,5 +1,5 @@ { "claudeSystemAppendBytes": 5597, "codexAdditionalContextBytes": 7327, - "mcpToolListJsonBytes": 48131 + "mcpToolListJsonBytes": 48236 } diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts index d1bb9961a0c68..df0307e2bd332 100644 --- a/packages/contracts/src/orchestratorMcp.ts +++ b/packages/contracts/src/orchestratorMcp.ts @@ -673,7 +673,8 @@ export const OrchestratorMcpScheduleTaskInput = Schema.Struct({ enabled: Schema.optional(Schema.Boolean.annotate({ description: "Default true." })), bindToCurrentThread: Schema.optional( Schema.Boolean.annotate({ - description: "Default true: runs post in this thread. False: new thread per run.", + description: + "Omitted: runs post in this thread when the task is in this thread's own project; otherwise a new thread per run. True: runs post in this thread. False: new thread per run.", }), ), freshSession: Schema.optional( From 0e8bc2d85bfeffdad207339e2c10ffc8fbcb169c Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Nov 2026 08:05:42 +0000 Subject: [PATCH 2/5] fix(server): describe how an omitted bindToCurrentThread behaves on update Omitting bindToCurrentThread when updating a task keeps the task's existing binding instead of recomputing the creation default, so say so. Drop the test that asserted the description's wording; the context budget test still covers this text. AI-assisted; verified with the tests and tools listed above. --- .../src/mcp/toolkits/orchestrator/tools.test.ts | 11 ----------- packages/contracts/src/orchestratorMcp.ts | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/apps/server/src/mcp/toolkits/orchestrator/tools.test.ts b/apps/server/src/mcp/toolkits/orchestrator/tools.test.ts index ca20390d3bde1..ea0caa4ce166a 100644 --- a/apps/server/src/mcp/toolkits/orchestrator/tools.test.ts +++ b/apps/server/src/mcp/toolkits/orchestrator/tools.test.ts @@ -17,17 +17,6 @@ it("states t3_thread_read page size limits in the parameter descriptions", () => } }); -// The server binds an omitted bindToCurrentThread only in the caller's own project; -// the schema description is the only place a model sees that default. -it("states the conditional bindToCurrentThread default in the schedule_task schema", () => { - const schema = Tool.getJsonSchema(OrchestratorToolkit.tools.schedule_task) as { - readonly properties: Readonly>; - }; - const serialized = JSON.stringify(schema.properties.bindToCurrentThread); - expect(serialized).toContain("this thread's own project"); - expect(serialized).not.toContain("Default true: runs post in this thread."); -}); - it("refuses a t3_thread_update whose fields do not fit its action", () => { const decode = Schema.decodeUnknownExit( OrchestratorToolkit.tools.t3_thread_update.parametersSchema, diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts index e9de069ced05c..0ef7eb1c4af9f 100644 --- a/packages/contracts/src/orchestratorMcp.ts +++ b/packages/contracts/src/orchestratorMcp.ts @@ -680,7 +680,7 @@ export const OrchestratorMcpScheduleTaskInput = Schema.Struct({ bindToCurrentThread: Schema.optional( Schema.Boolean.annotate({ description: - "Omitted: runs post in this thread when the task is in this thread's own project; otherwise a new thread per run. True: runs post in this thread. False: new thread per run.", + "True: runs post in this thread. False: new thread per run. Omitted on create: true when the task is in this thread's own project, else false. Omitted on update: unchanged.", }), ), freshSession: Schema.optional( From e897feadb2dff2759f7fb1595c7f4aa7b81e8ad1 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Nov 2026 09:10:43 +0000 Subject: [PATCH 3/5] fix(contracts): keep the bindToCurrentThread description within the agent context budget Co-Authored-By: Claude Opus 5.5 --- apps/server/src/provider/agentContextBudget.json | 2 +- packages/contracts/src/orchestratorMcp.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/server/src/provider/agentContextBudget.json b/apps/server/src/provider/agentContextBudget.json index d458e1c4fbbe4..486c4314927ad 100644 --- a/apps/server/src/provider/agentContextBudget.json +++ b/apps/server/src/provider/agentContextBudget.json @@ -1,5 +1,5 @@ { "claudeSystemAppendBytes": 5597, "codexAdditionalContextBytes": 7327, - "mcpToolListJsonBytes": 48236 + "mcpToolListJsonBytes": 48131 } diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts index 0ef7eb1c4af9f..688610dc9278c 100644 --- a/packages/contracts/src/orchestratorMcp.ts +++ b/packages/contracts/src/orchestratorMcp.ts @@ -679,8 +679,7 @@ export const OrchestratorMcpScheduleTaskInput = Schema.Struct({ enabled: Schema.optional(Schema.Boolean.annotate({ description: "Default true." })), bindToCurrentThread: Schema.optional( Schema.Boolean.annotate({ - description: - "True: runs post in this thread. False: new thread per run. Omitted on create: true when the task is in this thread's own project, else false. Omitted on update: unchanged.", + description: "Runs post in this thread. Default: true for this thread's project.", }), ), freshSession: Schema.optional( From ba9fb708d5e23650300de97285b18064a445f2ad Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Nov 2026 09:43:07 +0000 Subject: [PATCH 4/5] fix(contracts): bindToCurrentThread says other projects get a new thread per run Co-Authored-By: Claude Opus 5.5 --- packages/contracts/src/orchestratorMcp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts index 688610dc9278c..b472ff653759d 100644 --- a/packages/contracts/src/orchestratorMcp.ts +++ b/packages/contracts/src/orchestratorMcp.ts @@ -679,7 +679,7 @@ export const OrchestratorMcpScheduleTaskInput = Schema.Struct({ enabled: Schema.optional(Schema.Boolean.annotate({ description: "Default true." })), bindToCurrentThread: Schema.optional( Schema.Boolean.annotate({ - description: "Runs post in this thread. Default: true for this thread's project.", + description: "Runs post here, else new thread each. Default true in own project.", }), ), freshSession: Schema.optional( From 5490a9713bfa2213b5f64841e6d7168f6a144131 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Nov 2026 10:51:36 +0000 Subject: [PATCH 5/5] fix(contracts): bindToCurrentThread states its default outside the own project and on updates Unset means true in the agent's own project, false elsewhere, and an update keeps the task's current binding. Drop the freshSession clause that restated what a fresh session is so the tool list stays under main's agent context budget. AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 --- apps/server/src/provider/agentContextBudget.json | 2 +- packages/contracts/src/orchestratorMcp.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/server/src/provider/agentContextBudget.json b/apps/server/src/provider/agentContextBudget.json index 8ff4546b354a4..e166af3f78340 100644 --- a/apps/server/src/provider/agentContextBudget.json +++ b/apps/server/src/provider/agentContextBudget.json @@ -1,5 +1,5 @@ { "claudeSystemAppendBytes": 5597, "codexAdditionalContextBytes": 7327, - "mcpToolListJsonBytes": 48130 + "mcpToolListJsonBytes": 48126 } diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts index 21ca90e22975f..f668fb7743af0 100644 --- a/packages/contracts/src/orchestratorMcp.ts +++ b/packages/contracts/src/orchestratorMcp.ts @@ -679,13 +679,14 @@ export const OrchestratorMcpScheduleTaskInput = Schema.Struct({ enabled: Schema.optional(Schema.Boolean.annotate({ description: "Default true." })), bindToCurrentThread: Schema.optional( Schema.Boolean.annotate({ - description: "Runs post here, else new thread each. Default true in own project.", + description: + "Post here, else new thread per run. Unset: true in own project, else false; updates keep it.", }), ), freshSession: Schema.optional( Schema.Boolean.annotate({ description: - "Runs share one thread but each starts a fresh session without earlier runs' context. Unbound: the first run makes the thread.", + "Runs share one thread but each starts a fresh session. Unbound: the first run makes the thread.", }), ), clientRequestId: Schema.optional(OrchestratorMcpClientRequestId),