taskplane 0.24.13 → 0.24.15
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.
|
@@ -868,8 +868,17 @@ export async function resolveTaskMonitorState(
|
|
|
868
868
|
// to avoid indefinite false "running" if the lane-runner died.
|
|
869
869
|
const staleMs = snap?.updatedAt ? (now - snap.updatedAt) : 0;
|
|
870
870
|
if (staleMs > 30_000) {
|
|
871
|
-
// Snapshot hasn't been updated for 30s+ — check registry as fallback
|
|
872
|
-
|
|
871
|
+
// Snapshot hasn't been updated for 30s+ — check registry as fallback.
|
|
872
|
+
// But also check if the tracker just started (firstObservedAt within
|
|
873
|
+
// last 60s) — wave transitions can leave stale snapshots from the
|
|
874
|
+
// prior wave/task while the new worker is still spawning.
|
|
875
|
+
const trackerAgeMs = now - tracker.firstObservedAt;
|
|
876
|
+
if (trackerAgeMs < 60_000) {
|
|
877
|
+
// New task, stale snapshot — give the worker startup grace period
|
|
878
|
+
sessionAlive = true;
|
|
879
|
+
} else {
|
|
880
|
+
sessionAlive = isV2AgentAlive(sessionName, runtimeBackend);
|
|
881
|
+
}
|
|
873
882
|
} else {
|
|
874
883
|
sessionAlive = true;
|
|
875
884
|
}
|
|
@@ -1620,6 +1629,18 @@ export async function executeWave(
|
|
|
1620
1629
|
}
|
|
1621
1630
|
execLog("wave", `W${waveIndex}`, "using Runtime V2 backend (executeLaneV2)");
|
|
1622
1631
|
|
|
1632
|
+
// Clear stale lane snapshots from prior waves before launching new workers.
|
|
1633
|
+
// Without this, the monitor reads a snapshot from wave N-1 (different taskId,
|
|
1634
|
+
// staleMs > 30s) and may falsely mark the new task as failed before the
|
|
1635
|
+
// worker has time to write its first snapshot.
|
|
1636
|
+
const snapshotStateRoot = resolveRuntimeStateRoot(repoRoot, wsRoot);
|
|
1637
|
+
for (const lane of lanes) {
|
|
1638
|
+
try {
|
|
1639
|
+
const snapPath = join(snapshotStateRoot, ".pi", "runtime", batchId, "lanes", `lane-${lane.laneNumber}.json`);
|
|
1640
|
+
if (existsSync(snapPath)) unlinkSync(snapPath);
|
|
1641
|
+
} catch { /* best effort */ }
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1623
1644
|
const lanePromises = lanes.map(lane =>
|
|
1624
1645
|
executeLaneV2(lane, config, repoRoot, wavePauseSignal, wsRoot, isWsMode, { ORCH_BATCH_ID: batchId }, onSupervisorAlert),
|
|
1625
1646
|
);
|
|
@@ -1968,8 +1989,15 @@ export function buildExecutionUnit(
|
|
|
1968
1989
|
const segmentId = task.task.activeSegmentId ?? null;
|
|
1969
1990
|
const id = segmentId ?? task.taskId;
|
|
1970
1991
|
|
|
1971
|
-
|
|
1972
|
-
|
|
1992
|
+
// Use absolute packetTaskPath ONLY when the packet home repo differs from
|
|
1993
|
+
// the execution repo (cross-repo segment). When they're the same repo,
|
|
1994
|
+
// resolve packet paths inside the worktree so .DONE, STATUS.md etc. are
|
|
1995
|
+
// written to the worktree (not the original repo outside the worktree).
|
|
1996
|
+
const useAbsolutePacketPath = task.task.packetTaskPath
|
|
1997
|
+
&& packetHomeRepoId !== executionRepoId;
|
|
1998
|
+
|
|
1999
|
+
const packet = useAbsolutePacketPath
|
|
2000
|
+
? resolvePacketPaths(task.task.packetTaskPath!)
|
|
1973
2001
|
: {
|
|
1974
2002
|
promptPath: resolved.taskFolderResolved + "/PROMPT.md",
|
|
1975
2003
|
statusPath: resolved.statusPath,
|