@mndrk/agx 1.4.27 → 1.4.29
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/lib/cloud/status.js +6 -1
- package/lib/storage/runs.js +10 -2
- package/package.json +1 -1
package/lib/cloud/status.js
CHANGED
|
@@ -29,10 +29,15 @@ function buildCloudTaskTerminalPatch({ decision, newStage, nowIso } = {}) {
|
|
|
29
29
|
return { status: 'completed', completed_at: now };
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
// NOTE: decision "done" means the CURRENT STAGE is complete, not the entire task.
|
|
33
|
+
// Only mark task as completed when stage reaches "done" (handled above).
|
|
34
|
+
// Do NOT mark completed just because decision is "done" - that prematurely
|
|
35
|
+
// ends tasks stuck in ideation/planning/execution.
|
|
33
36
|
if (d === 'failed') return { status: 'failed', completed_at: now };
|
|
34
37
|
if (d === 'blocked') return { status: 'blocked' };
|
|
35
38
|
|
|
39
|
+
// For "done" and "not_done" decisions, let the stage machine handle transitions.
|
|
40
|
+
// The task status will be updated by the orchestrator based on stage progression.
|
|
36
41
|
return null;
|
|
37
42
|
}
|
|
38
43
|
|
package/lib/storage/runs.js
CHANGED
|
@@ -110,9 +110,17 @@ async function createRun({ projectSlug, taskSlug, stage, runId: explicitRunId, e
|
|
|
110
110
|
await ensureDir(paths.root);
|
|
111
111
|
await ensureDir(paths.artifacts);
|
|
112
112
|
|
|
113
|
-
//
|
|
113
|
+
// If run already exists, return handle to existing run (idempotent)
|
|
114
114
|
if (await fileExists(paths.meta)) {
|
|
115
|
-
|
|
115
|
+
const existingMeta = await readJson(paths.meta);
|
|
116
|
+
return {
|
|
117
|
+
runId: existingMeta.run_id || runId,
|
|
118
|
+
paths,
|
|
119
|
+
projectSlug,
|
|
120
|
+
taskSlug,
|
|
121
|
+
stage,
|
|
122
|
+
meta: existingMeta,
|
|
123
|
+
};
|
|
116
124
|
}
|
|
117
125
|
|
|
118
126
|
const now = new Date().toISOString();
|