@kynver-app/runtime 0.1.7 → 0.1.8
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/dist/cli.js +18 -11
- package/dist/cli.js.map +2 -2
- package/dist/index.js +18 -11
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1501,7 +1501,7 @@ import path12 from "node:path";
|
|
|
1501
1501
|
// src/plan-progress-sync.ts
|
|
1502
1502
|
async function syncPlanProgress(args) {
|
|
1503
1503
|
const base = resolveBaseUrl(args.baseUrl);
|
|
1504
|
-
const secret = resolveCallbackSecret(args.secret);
|
|
1504
|
+
const secret = resolveCallbackSecret(args.secret, args.agentOsId);
|
|
1505
1505
|
const url = `${base}/api/agent-os/by-id/${encodeURIComponent(args.agentOsId)}/tasks/${encodeURIComponent(args.taskId)}/plan-progress-sync`;
|
|
1506
1506
|
const res = await postJson(url, secret, {
|
|
1507
1507
|
phase: args.phase,
|
|
@@ -1525,17 +1525,24 @@ async function syncActiveWorkerPlanProgress(runId, args) {
|
|
|
1525
1525
|
);
|
|
1526
1526
|
if (!worker?.dispatched || !worker.taskId) continue;
|
|
1527
1527
|
const status = computeWorkerStatus(worker);
|
|
1528
|
-
if (status.heartbeatBlocker)
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1528
|
+
if (!status.heartbeatBlocker) continue;
|
|
1529
|
+
if (worker.lastSyncedHeartbeatBlocker === status.heartbeatBlocker) {
|
|
1530
|
+
outcomes.push({ worker: name, phase: "heartbeat_blocker", ok: true, skipped: true });
|
|
1531
|
+
continue;
|
|
1532
|
+
}
|
|
1533
|
+
const res = await syncPlanProgress({
|
|
1534
|
+
agentOsId,
|
|
1535
|
+
taskId: worker.taskId,
|
|
1536
|
+
phase: "heartbeat_blocker",
|
|
1537
|
+
blocker: status.heartbeatBlocker,
|
|
1538
|
+
baseUrl: args.baseUrl ? String(args.baseUrl) : void 0,
|
|
1539
|
+
secret: args.secret ? String(args.secret) : void 0
|
|
1540
|
+
});
|
|
1541
|
+
if (res.ok) {
|
|
1542
|
+
worker.lastSyncedHeartbeatBlocker = status.heartbeatBlocker;
|
|
1543
|
+
saveWorker(run.id, worker);
|
|
1538
1544
|
}
|
|
1545
|
+
outcomes.push({ worker: name, phase: "heartbeat_blocker", ok: res.ok });
|
|
1539
1546
|
}
|
|
1540
1547
|
return outcomes;
|
|
1541
1548
|
}
|