Problem#
An agent cannot switch an existing scheduled task to fresh sessions. schedule_task with scheduledTaskId and freshSession: true returns success, but the task keeps its old destination and the result shows freshSession: false.
Call path: the schedule_task tool's update branch in apps/server/src/mcp/toolkits/orchestrator/handlers.ts picks out prompt, title, schedule, enabled and bindToCurrentThread before it calls OrchestratorMcpService.updateScheduledTask, and leaves out freshSession. #30326 added freshSession to the update input and taught updateScheduledTask to map it to a thread mode, but its tests call the service directly, so they never went through the handler. Because the field never reaches the service, the refusal in updateScheduledTask that tells agents to "set freshSession: true in a second call" also gives advice the real tool silently ignores.
Change#
The update branch now passes freshSession through to updateScheduledTask, like the other fields.
Scope and approval#
This is a one-line fix for an obvious bug in the feature #30326 just added. The tool's schema and the service already accept the field; the handler dropped it. It changes nothing outside this tool call.
Verification#
New test in apps/server/src/mcp/toolkits/core.test.ts, "schedule_task switches an existing task to fresh sessions". It calls the real schedule_task tool through the in-process MCP server and checks both the saved thread mode and the tool result.
Before the fix (upstream/main):
- Expected
+ Received
[
- "fresh_session",
+ "new_thread",
]
Tests 1 failed | 20 skipped (21)
With the fix:
Test Files 1 passed (1)
Tests 21 passed (21)
Other checks: targeted vp lint and vp fmt --check on apps/server/src/mcp/toolkits, and the apps/server typecheck (0 errors).
Not checked: a live agent calling the tool against a running server.
Claude Opus 5.5 (Claude Code desktop app)
🤖 Generated with Claude Code
No actionable comments were generated in the recent review.
Walkthrough
The scheduled-task update handler now forwards
freshSessiontoupdateScheduledTask. A test verifies that the update input setsthreadModeto"fresh_session"and that the response reportsfreshSession: true.Changes: Scheduled-task update
apps/server/src/mcp/toolkits/orchestrator/handlers.ts,apps/server/src/mcp/toolkits/core.test.tsfreshSessiontoupdateScheduledTask. The test checks that the upsert input usesthreadMode: "fresh_session"and that the response reportsfreshSession: true.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
mainworktree base that the issue identifies.Suggested reviewers:
t3dotggMerge Risk:
Minimal · up to
7080aThe change enables existing scheduled tasks to use fresh sessions. No merge-blocking issue was established.
Pre-merge checks:
4
Full details: Title check
Explanation
The title names the main change: schedule_task can now switch an existing task to fresh sessions. The raw summary and objectives confirm the handler now passes freshSession to updateScheduledTask. The title is specific, uses a conventional commit prefix, and is a single sentence. It is 72 characters, which is slightly long but acceptable.
Full details: Description check
Explanation
The description follows the template sections (Problem, Change, Scope and approval, Verification). The Problem section gives the expected behavior, the reproduction path, and the root cause in the handler. The Change section explains the one-line fix. Scope and approval explains why no prior issue is needed: a one-line fix for an obvious bug in a just-added feature. Verification gives a new focused test, before and after results, and lint, format, and typecheck runs, and it states what was not checked. The description does not link a triaged issue or maintainer approval. It relies on the small-obvious-fix exemption, which the template allows, so this is a reasonable pass.
Finishing Touches
Generate unit tests (beta)
71ee4aac-32a6-4aee-809a-530cbc1fd5feReviewing files that changed from the base of the PR and between 37481f044e749a658d94a927b33b268a733f94c5 and 7080a89dc2091b07854b34b75ff5140446442795.
apps/server/src/mcp/toolkits/core.test.tsapps/server/src/mcp/toolkits/orchestrator/handlers.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.