fix(FN-4601): finalize retry reclaim recovery and docs

Fusion-Task-Id: FN-4601
Fusion-Task-Lineage: 136888a7-aee7-4eda-a165-16448a98e626
This commit is contained in:
Fusion
2026-05-15 07:17:18 -07:00
committed by gsxdsm
parent 5bef3daf47
commit 75c327ca45
3 changed files with 12 additions and 6 deletions

View File

@@ -3790,11 +3790,12 @@ export class TaskExecutor {
let retryAbortedDueToReclaim = false;
while (!taskDone && taskDoneSessionRetries < MAX_TASK_DONE_SESSION_RETRIES) {
const liveTask = await this.store.getTask(task.id);
const worktreeContractIntact = liveTask.worktree === worktreePath
&& typeof liveTask.branch === "string"
&& liveTask.branch.length > 0
&& liveTask.column === "in-progress"
&& !liveTask.paused;
const hasExplicitWorktreeBinding = typeof liveTask.worktree === "string" || liveTask.worktree === null;
const hasExplicitBranchBinding = typeof liveTask.branch === "string" || liveTask.branch === null;
const worktreeContractIntact = liveTask.column === "in-progress"
&& !liveTask.paused
&& (!hasExplicitWorktreeBinding || liveTask.worktree === worktreePath)
&& (!hasExplicitBranchBinding || (typeof liveTask.branch === "string" && liveTask.branch.length > 0));
if (!worktreeContractIntact) {
const reclaimMessage = `${task.id}: worktree/branch reclaimed during no-fn_task_done retry — aborting retry and requeueing`;
executorLog.log(reclaimMessage);