taskplane 0.21.2 → 0.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1069,9 +1069,37 @@ export async function pollUntilTaskComplete(
|
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
1071
|
|
|
1072
|
-
// Grace period expired
|
|
1072
|
+
// Grace period expired — last resort: check the lane BRANCH for .DONE.
|
|
1073
|
+
// The worker may have committed .DONE before the session exited, but
|
|
1074
|
+
// the worktree filesystem doesn't reflect it (stale checkout, race).
|
|
1075
|
+
// This handles the common case where the worker completes all work,
|
|
1076
|
+
// commits .DONE, and then the session exits before the poll detects it.
|
|
1077
|
+
{
|
|
1078
|
+
const relDonePath = donePath.startsWith(lane.worktreePath)
|
|
1079
|
+
? donePath.slice(lane.worktreePath.length).replace(/^[\\/]+/, "").replace(/\\/g, "/")
|
|
1080
|
+
: null;
|
|
1081
|
+
if (relDonePath) {
|
|
1082
|
+
const gitResult = runGit(
|
|
1083
|
+
["show", `${lane.branch}:${relDonePath}`],
|
|
1084
|
+
lane.worktreePath,
|
|
1085
|
+
);
|
|
1086
|
+
if (gitResult.ok) {
|
|
1087
|
+
execLog(laneId, task.taskId, ".DONE found on lane branch (not in worktree) — task succeeded", {
|
|
1088
|
+
session: sessionName,
|
|
1089
|
+
branch: lane.branch,
|
|
1090
|
+
});
|
|
1091
|
+
return {
|
|
1092
|
+
status: "succeeded",
|
|
1093
|
+
exitReason: ".DONE committed to lane branch (found via git show after grace period)",
|
|
1094
|
+
doneFileFound: true,
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// Truly failed — no .DONE on filesystem or branch
|
|
1073
1101
|
const logTail = await readLaneLogTailAsync(laneLogPath);
|
|
1074
|
-
execLog(laneId, task.taskId, "grace period expired
|
|
1102
|
+
execLog(laneId, task.taskId, "grace period expired, no .DONE on filesystem or branch — task failed", {
|
|
1075
1103
|
session: sessionName,
|
|
1076
1104
|
logPath: laneLogPath,
|
|
1077
1105
|
});
|