@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/cli.js
CHANGED
|
@@ -1476,7 +1476,7 @@ import path12 from "node:path";
|
|
|
1476
1476
|
// src/plan-progress-sync.ts
|
|
1477
1477
|
async function syncPlanProgress(args) {
|
|
1478
1478
|
const base = resolveBaseUrl(args.baseUrl);
|
|
1479
|
-
const secret = resolveCallbackSecret(args.secret);
|
|
1479
|
+
const secret = resolveCallbackSecret(args.secret, args.agentOsId);
|
|
1480
1480
|
const url = `${base}/api/agent-os/by-id/${encodeURIComponent(args.agentOsId)}/tasks/${encodeURIComponent(args.taskId)}/plan-progress-sync`;
|
|
1481
1481
|
const res = await postJson(url, secret, {
|
|
1482
1482
|
phase: args.phase,
|
|
@@ -1500,17 +1500,24 @@ async function syncActiveWorkerPlanProgress(runId, args) {
|
|
|
1500
1500
|
);
|
|
1501
1501
|
if (!worker?.dispatched || !worker.taskId) continue;
|
|
1502
1502
|
const status = computeWorkerStatus(worker);
|
|
1503
|
-
if (status.heartbeatBlocker)
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1503
|
+
if (!status.heartbeatBlocker) continue;
|
|
1504
|
+
if (worker.lastSyncedHeartbeatBlocker === status.heartbeatBlocker) {
|
|
1505
|
+
outcomes.push({ worker: name, phase: "heartbeat_blocker", ok: true, skipped: true });
|
|
1506
|
+
continue;
|
|
1507
|
+
}
|
|
1508
|
+
const res = await syncPlanProgress({
|
|
1509
|
+
agentOsId,
|
|
1510
|
+
taskId: worker.taskId,
|
|
1511
|
+
phase: "heartbeat_blocker",
|
|
1512
|
+
blocker: status.heartbeatBlocker,
|
|
1513
|
+
baseUrl: args.baseUrl ? String(args.baseUrl) : void 0,
|
|
1514
|
+
secret: args.secret ? String(args.secret) : void 0
|
|
1515
|
+
});
|
|
1516
|
+
if (res.ok) {
|
|
1517
|
+
worker.lastSyncedHeartbeatBlocker = status.heartbeatBlocker;
|
|
1518
|
+
saveWorker(run.id, worker);
|
|
1513
1519
|
}
|
|
1520
|
+
outcomes.push({ worker: name, phase: "heartbeat_blocker", ok: res.ok });
|
|
1514
1521
|
}
|
|
1515
1522
|
return outcomes;
|
|
1516
1523
|
}
|