Skip to content

Commit 0741333

Browse files
some-du6eclaude
andcommitted
fix(server): project moves wait for failed worktree setup to resolve
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 594693b commit 0741333

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,6 +3002,19 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
30023002
cause: `Thread ${command.threadId} is busy. Stop it or clear its queue before moving it.`,
30033003
});
30043004
}
3005+
// Failed worktree setup holds the queue and would retry in the old project's repo.
3006+
const latestRun = latestExecutedRun(records.runs);
3007+
if (
3008+
(latestRun?.status === "failed" || latestRun?.status === "interrupted") &&
3009+
latestRun.workspacePreparation?.type === "worktree" &&
3010+
thread.worktreePath === null
3011+
) {
3012+
return yield* new OrchestratorDispatchError({
3013+
commandId: command.commandId,
3014+
commandType: command.type,
3015+
cause: `Thread ${command.threadId} has failed worktree setup. Retry it or continue locally before moving.`,
3016+
});
3017+
}
30053018
}
30063019
if (command.type === "thread.archive" && thread.archivedAt !== null) {
30073020
return yield* new OrchestratorDispatchError({

0 commit comments

Comments
 (0)