taskplane 0.23.1 → 0.23.2
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.
package/dashboard/server.cjs
CHANGED
|
@@ -1015,6 +1015,39 @@ function buildDashboardState() {
|
|
|
1015
1015
|
const runtimeLaneSnapshots = loadRuntimeLaneSnapshots(state.batchId);
|
|
1016
1016
|
const mailboxData = loadMailboxData(state.batchId);
|
|
1017
1017
|
|
|
1018
|
+
// TP-115: Synthesize laneStates from V2 snapshots so the dashboard
|
|
1019
|
+
// pipeline works without legacy lane-state-*.json sidecar files.
|
|
1020
|
+
// V2 snapshots are authoritative when present.
|
|
1021
|
+
if (Object.keys(runtimeLaneSnapshots).length > 0) {
|
|
1022
|
+
for (const [laneNum, snap] of Object.entries(runtimeLaneSnapshots)) {
|
|
1023
|
+
// Find the matching lane record to get the session name key
|
|
1024
|
+
const laneRec = (state.lanes || []).find(l => l.laneNumber === Number(laneNum));
|
|
1025
|
+
const key = laneRec ? laneRec.tmuxSessionName : `lane-${laneNum}`;
|
|
1026
|
+
if (!laneStates[key] || (snap.updatedAt && snap.updatedAt > (laneStates[key].timestamp || 0))) {
|
|
1027
|
+
const w = snap.worker || {};
|
|
1028
|
+
const statusMap = { running: "running", spawning: "running", exited: "done", crashed: "error", killed: "error", timed_out: "error", wrapping_up: "running" };
|
|
1029
|
+
laneStates[key] = {
|
|
1030
|
+
prefix: key,
|
|
1031
|
+
taskId: snap.taskId || null,
|
|
1032
|
+
phase: snap.status === "running" ? "worker-active" : snap.status === "complete" ? "complete" : "idle",
|
|
1033
|
+
workerStatus: statusMap[w.status] || w.status || "idle",
|
|
1034
|
+
workerElapsed: w.elapsedMs || 0,
|
|
1035
|
+
workerContextPct: w.contextPct || 0,
|
|
1036
|
+
workerLastTool: w.lastTool || "",
|
|
1037
|
+
workerToolCount: w.toolCalls || 0,
|
|
1038
|
+
workerInputTokens: w.inputTokens || 0,
|
|
1039
|
+
workerOutputTokens: w.outputTokens || 0,
|
|
1040
|
+
workerCacheReadTokens: w.cacheReadTokens || 0,
|
|
1041
|
+
workerCacheWriteTokens: w.cacheWriteTokens || 0,
|
|
1042
|
+
workerCostUsd: w.costUsd || 0,
|
|
1043
|
+
reviewerStatus: "idle",
|
|
1044
|
+
batchId: snap.batchId || state.batchId,
|
|
1045
|
+
timestamp: snap.updatedAt || Date.now(),
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1018
1051
|
return {
|
|
1019
1052
|
laneStates,
|
|
1020
1053
|
telemetry,
|