Skip to content

Commit ccf20b9

Browse files
fix(server): scheduled task updates keep the saved workspace unless the binding flips
Updating a scheduled task over MCP with bindToCurrentThread recomputed its workspace strategy even when the binding did not change, so passing false on an already-unbound task reset a user's "Use the project checkout" choice to a new worktree. The strategy is now recomputed only when the task moves between bound and unbound; unbinding a bound task still switches it to a worktree. Fixes #32491 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d7f86e9 commit ccf20b9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/server/src/mcp/OrchestratorMcpService.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,11 +2099,11 @@ const make = Effect.gen(function* () {
20992099
: input.bindToCurrentThread && parent !== undefined
21002100
? parent.thread.id
21012101
: null;
2102-
// Update workspace strategy on rebinding so unbound root tasks cannot run in the shared checkout.
2102+
// Reset the workspace only when the binding flips, so unbinding cannot leave runs in the shared checkout.
21032103
const workspaceStrategy =
2104-
input.bindToCurrentThread === undefined
2104+
(threadId === null) === (existing.threadId === null)
21052105
? existing.workspaceStrategy
2106-
: yield* scheduledTaskWorkspaceStrategy(input.bindToCurrentThread, existing.projectId);
2106+
: yield* scheduledTaskWorkspaceStrategy(threadId !== null, existing.projectId);
21072107
const upsertInput: ScheduledTaskUpsertInput = {
21082108
id: existing.id,
21092109
title: input.title ?? existing.title,

0 commit comments

Comments
 (0)