@e4779/pi-fabric 0.105.0-fork.18 → 0.109.2-fork.23
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/README.md +3 -1
- package/dist/actors/global-registry.d.ts.map +1 -1
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/result.d.ts.map +1 -1
- package/dist/agents/result.js +1 -1
- package/dist/agents/runner-registry.d.ts +1 -1
- package/dist/agents/runner-registry.d.ts.map +1 -1
- package/dist/agents.js +5 -5
- package/dist/chunks/{chunk-5MNLVHF5.js → chunk-3DUKKQHN.js} +28 -13
- package/dist/chunks/chunk-3DUKKQHN.js.map +7 -0
- package/dist/chunks/{chunk-GJVPP3NN.js → chunk-3SHUUBZJ.js} +4 -4
- package/dist/chunks/chunk-3SHUUBZJ.js.map +7 -0
- package/dist/chunks/{chunk-VON4TSO3.js → chunk-CZPQTISQ.js} +27 -2
- package/dist/chunks/chunk-CZPQTISQ.js.map +7 -0
- package/dist/chunks/{chunk-WLLXKS6I.js → chunk-DU6ZA44F.js} +4 -4
- package/dist/chunks/{chunk-QLFDPXK7.js → chunk-DV2JZSCI.js} +153 -27
- package/dist/chunks/chunk-DV2JZSCI.js.map +7 -0
- package/dist/chunks/{chunk-KQ6R5EWR.js → chunk-FRPNQZV2.js} +24 -22
- package/dist/chunks/chunk-FRPNQZV2.js.map +7 -0
- package/dist/chunks/{chunk-W7X4XEQU.js → chunk-GC2AUXG6.js} +2 -2
- package/dist/chunks/chunk-K6QXUGS5.js +30 -0
- package/dist/chunks/chunk-K6QXUGS5.js.map +7 -0
- package/dist/chunks/{chunk-VPRJOD4Y.js → chunk-LEDY5G2V.js} +2 -2
- package/dist/chunks/{chunk-OVBKQCYL.js → chunk-N2VKKA7O.js} +2 -2
- package/dist/chunks/{chunk-N5GUXC6F.js → chunk-P4KH4S4S.js} +2 -1
- package/dist/chunks/chunk-P4KH4S4S.js.map +7 -0
- package/dist/chunks/{chunk-TFFZVLR2.js → chunk-PF27MQY5.js} +55 -4
- package/dist/chunks/chunk-PF27MQY5.js.map +7 -0
- package/dist/chunks/{chunk-CGL7QP4A.js → chunk-PK4NIJEV.js} +10 -1
- package/dist/chunks/{chunk-CGL7QP4A.js.map → chunk-PK4NIJEV.js.map} +2 -2
- package/dist/chunks/{chunk-YRDCJZZW.js → chunk-RUO6L7RM.js} +1 -1
- package/dist/chunks/{chunk-YRDCJZZW.js.map → chunk-RUO6L7RM.js.map} +1 -1
- package/dist/chunks/{chunk-4RTHQGES.js → chunk-ST36EYHN.js} +4 -4
- package/dist/chunks/chunk-ST36EYHN.js.map +7 -0
- package/dist/chunks/{chunk-R5F6CHW2.js → chunk-UXEMIWYI.js} +12 -7
- package/dist/chunks/chunk-UXEMIWYI.js.map +7 -0
- package/dist/chunks/{chunk-SGFH5PYA.js → chunk-V2SKDVQX.js} +10 -9
- package/dist/chunks/chunk-V2SKDVQX.js.map +7 -0
- package/dist/chunks/{chunk-KYXZJNV6.js → chunk-VTK2FEH7.js} +3 -1
- package/dist/chunks/{chunk-KYXZJNV6.js.map → chunk-VTK2FEH7.js.map} +2 -2
- package/dist/chunks/{chunk-3QECYQGA.js → chunk-VYQV5JRT.js} +13 -1
- package/dist/chunks/chunk-VYQV5JRT.js.map +7 -0
- package/dist/chunks/{chunk-3KDUMDPZ.js → chunk-X3CHSIL2.js} +5 -5
- package/dist/chunks/{chunk-6VXPACGC.js → chunk-YJX27XBO.js} +100 -22
- package/dist/chunks/chunk-YJX27XBO.js.map +7 -0
- package/dist/components/configuration.js +2 -2
- package/dist/config.d.ts +16 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/core/action-registry.d.ts +1 -1
- package/dist/core/action-registry.d.ts.map +1 -1
- package/dist/core/action-registry.js +2 -2
- package/dist/core/media-sanitize.d.ts.map +1 -1
- package/dist/core/native-tool-names.d.ts +9 -0
- package/dist/core/native-tool-names.d.ts.map +1 -0
- package/dist/core/native-tool-result.d.ts +11 -0
- package/dist/core/native-tool-result.d.ts.map +1 -0
- package/dist/core/system-guidance.d.ts +3 -3
- package/dist/core/system-guidance.d.ts.map +1 -1
- package/dist/durable/agent.d.ts +77 -0
- package/dist/durable/agent.d.ts.map +1 -0
- package/dist/durable/session.d.ts +19 -0
- package/dist/durable/session.d.ts.map +1 -0
- package/dist/durable/storage.d.ts +7 -0
- package/dist/durable/storage.d.ts.map +1 -0
- package/dist/durable/worker-host.d.ts +13 -0
- package/dist/durable/worker-host.d.ts.map +1 -0
- package/dist/durable/worker-host.js +1149 -0
- package/dist/durable/worker-host.js.map +7 -0
- package/dist/durable/worker-options.d.ts +17 -0
- package/dist/durable/worker-options.d.ts.map +1 -0
- package/dist/durable/worker.d.ts +3 -0
- package/dist/durable/worker.d.ts.map +1 -0
- package/dist/durable/worker.js +110 -0
- package/dist/durable/worker.js.map +7 -0
- package/dist/durable-controls.d.ts +27 -0
- package/dist/durable-controls.d.ts.map +1 -0
- package/dist/durable-input.d.ts +13 -0
- package/dist/durable-input.d.ts.map +1 -0
- package/dist/durable.d.ts +6 -0
- package/dist/durable.d.ts.map +1 -1
- package/dist/durable.js +194 -24
- package/dist/durable.js.map +4 -4
- package/dist/execution-service.d.ts +4 -0
- package/dist/execution-service.d.ts.map +1 -1
- package/dist/extension-bootstrap.js +5 -5
- package/dist/extension.d.ts.map +1 -1
- package/dist/fabric-exec-arguments.d.ts.map +1 -1
- package/dist/fabric-exec-tool.d.ts.map +1 -1
- package/dist/fabric-runtime-state.d.ts.map +1 -1
- package/dist/fabric-runtime-state.js +633 -291
- package/dist/fabric-runtime-state.js.map +4 -4
- package/dist/index.js +5 -5
- package/dist/jev/observation.js +2 -2
- package/dist/jev.js +3 -3
- package/dist/mcp.js +1 -1
- package/dist/memory/extractive-history.d.ts +29 -0
- package/dist/memory/extractive-history.d.ts.map +1 -0
- package/dist/memory/extractive-history.js +340 -0
- package/dist/memory/extractive-history.js.map +7 -0
- package/dist/memory/extractive-index.d.ts +46 -0
- package/dist/memory/extractive-index.d.ts.map +1 -0
- package/dist/native-codemode.d.ts +34 -0
- package/dist/native-codemode.d.ts.map +1 -0
- package/dist/native-discovery.d.ts +16 -0
- package/dist/native-discovery.d.ts.map +1 -0
- package/dist/native-discovery.js +19 -0
- package/dist/native-discovery.js.map +7 -0
- package/dist/native-image-artifacts.d.ts +4 -0
- package/dist/native-image-artifacts.d.ts.map +1 -0
- package/dist/native-image-artifacts.js +18 -0
- package/dist/native-image-artifacts.js.map +7 -0
- package/dist/native-tool-catalog.d.ts +21 -0
- package/dist/native-tool-catalog.d.ts.map +1 -0
- package/dist/native-tool-catalog.js +71 -0
- package/dist/native-tool-catalog.js.map +7 -0
- package/dist/protocol.d.ts +2 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +1 -1
- package/dist/providers/agents-provider.d.ts.map +1 -1
- package/dist/providers/captured-tools-provider.d.ts +1 -1
- package/dist/providers/captured-tools-provider.d.ts.map +1 -1
- package/dist/providers/jev-provider.js +3 -3
- package/dist/providers/mcp-provider.d.ts +1 -1
- package/dist/providers/mcp-provider.d.ts.map +1 -1
- package/dist/providers/pi-native-mcp.d.ts.map +1 -1
- package/dist/providers/pi-tools-provider.d.ts.map +1 -1
- package/dist/residency/host.js +7 -7
- package/dist/residency/pi-entry.js +7 -7
- package/dist/runners.js +1 -1
- package/dist/runtime/core-override-guest-types.js +2 -2
- package/dist/runtime/dynamic-guest-types.d.ts +2 -0
- package/dist/runtime/dynamic-guest-types.d.ts.map +1 -1
- package/dist/runtime/dynamic-guest-types.js +5 -3
- package/dist/runtime/guest-types.d.ts +1 -1
- package/dist/runtime/guest-types.d.ts.map +1 -1
- package/dist/runtime/guest-types.js +1 -1
- package/dist/runtime/kernel.d.ts +5 -0
- package/dist/runtime/kernel.d.ts.map +1 -1
- package/dist/runtime/monty-runtime.js +1 -1
- package/dist/runtime/native-codemode-guest.d.ts +2 -0
- package/dist/runtime/native-codemode-guest.d.ts.map +1 -0
- package/dist/runtime/native-codemode-types.d.ts +2 -0
- package/dist/runtime/native-codemode-types.d.ts.map +1 -0
- package/dist/runtime/node-process-child-source.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.d.ts.map +1 -1
- package/dist/runtime/node-process-runtime.js +3 -3
- package/dist/runtime/quickjs-runtime.d.ts +1 -1
- package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
- package/dist/runtime/quickjs-runtime.js +3 -2
- package/dist/runtime/type-checker.d.ts +2 -0
- package/dist/runtime/type-checker.d.ts.map +1 -1
- package/dist/runtime/type-checker.js +5 -3
- package/dist/runtime/typescript-kernel.d.ts +1 -1
- package/dist/runtime/typescript-kernel.d.ts.map +1 -1
- package/dist/runtime/typescript-kernel.js +13 -11
- package/dist/runtime/typescript-kernel.js.map +2 -2
- package/dist/runtime-state-speculation.d.ts +4 -1
- package/dist/runtime-state-speculation.d.ts.map +1 -1
- package/dist/speculation/python-scanner.js +1 -1
- package/dist/speculation/python-scanner.js.map +2 -2
- package/dist/speculation/scanner.d.ts +2 -0
- package/dist/speculation/scanner.d.ts.map +1 -1
- package/dist/speculation/scanner.js +18 -4
- package/dist/speculation/scanner.js.map +2 -2
- package/dist/speculation/types.d.ts +1 -0
- package/dist/speculation/types.d.ts.map +1 -1
- package/dist/type-error-guidance.js +1 -1
- package/dist/ui/border-status-editor.d.ts +3 -0
- package/dist/ui/border-status-editor.d.ts.map +1 -1
- package/dist/ui/controller.d.ts.map +1 -1
- package/dist/ui/conversation.d.ts +1 -0
- package/dist/ui/conversation.d.ts.map +1 -1
- package/dist/ui/conversation.js +28 -5
- package/dist/ui/conversation.js.map +2 -2
- package/dist/ui/dashboard.d.ts +2 -0
- package/dist/ui/dashboard.d.ts.map +1 -1
- package/dist/ui/dashboard.js +20 -7
- package/dist/ui/dashboard.js.map +2 -2
- package/dist/ui/settings-section-context.d.ts +2 -0
- package/dist/ui/settings-section-context.d.ts.map +1 -1
- package/dist/ui/settings-sections-execution.d.ts.map +1 -1
- package/dist/ui/settings-sections-lifecycle.d.ts +1 -0
- package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -1
- package/dist/ui/settings-sections.d.ts +2 -0
- package/dist/ui/settings-sections.d.ts.map +1 -1
- package/dist/ui/settings-values.d.ts +4 -1
- package/dist/ui/settings-values.d.ts.map +1 -1
- package/dist/ui/settings.d.ts.map +1 -1
- package/dist/ui/settings.js +61 -2
- package/dist/ui/settings.js.map +2 -2
- package/dist/worker/model-control.d.ts.map +1 -1
- package/dist/worker/model-control.js.map +2 -2
- package/dist/worker/options.d.ts.map +1 -1
- package/dist/worker/options.js +4 -3
- package/dist/worker/options.js.map +2 -2
- package/dist/worker/result.js +12 -0
- package/dist/worker/result.js.map +2 -2
- package/dist/worker.js +95 -8
- package/dist/worker.js.map +2 -2
- package/docs/agents.md +5 -5
- package/docs/codemode-parity.md +97 -0
- package/docs/configuration.md +31 -2
- package/docs/durable-pi.md +166 -38
- package/docs/extractive-history.md +171 -0
- package/docs/interface.md +1 -1
- package/docs/speculation.md +12 -3
- package/package.json +7 -16
- package/skillsets/typescript/fabric-exec/SKILL.md +4 -4
- package/dist/chunks/chunk-3QECYQGA.js.map +0 -7
- package/dist/chunks/chunk-4RTHQGES.js.map +0 -7
- package/dist/chunks/chunk-5MNLVHF5.js.map +0 -7
- package/dist/chunks/chunk-6VXPACGC.js.map +0 -7
- package/dist/chunks/chunk-GJVPP3NN.js.map +0 -7
- package/dist/chunks/chunk-KQ6R5EWR.js.map +0 -7
- package/dist/chunks/chunk-N5GUXC6F.js.map +0 -7
- package/dist/chunks/chunk-QLFDPXK7.js.map +0 -7
- package/dist/chunks/chunk-R5F6CHW2.js.map +0 -7
- package/dist/chunks/chunk-SGFH5PYA.js.map +0 -7
- package/dist/chunks/chunk-TFFZVLR2.js.map +0 -7
- package/dist/chunks/chunk-VON4TSO3.js.map +0 -7
- /package/dist/chunks/{chunk-WLLXKS6I.js.map → chunk-DU6ZA44F.js.map} +0 -0
- /package/dist/chunks/{chunk-W7X4XEQU.js.map → chunk-GC2AUXG6.js.map} +0 -0
- /package/dist/chunks/{chunk-VPRJOD4Y.js.map → chunk-LEDY5G2V.js.map} +0 -0
- /package/dist/chunks/{chunk-OVBKQCYL.js.map → chunk-N2VKKA7O.js.map} +0 -0
- /package/dist/chunks/{chunk-3KDUMDPZ.js.map → chunk-X3CHSIL2.js.map} +0 -0
package/dist/worker.js
CHANGED
|
@@ -225,6 +225,7 @@ var main = async () => {
|
|
|
225
225
|
writeRunRecord
|
|
226
226
|
} = loadedRunRecordHelpers;
|
|
227
227
|
const options = optionHelpers.parseWorkerOptions();
|
|
228
|
+
const isPi = options.runner === "pi" || options.runner === "pi-durable";
|
|
228
229
|
const sessionExporter = options.sessionExportFile ? new sessionExportHelpers.SessionExporter({
|
|
229
230
|
file: options.sessionExportFile,
|
|
230
231
|
sessionId: options.id,
|
|
@@ -269,7 +270,7 @@ ${task}
|
|
|
269
270
|
if (!options.extensions) piArguments.push("--no-extensions");
|
|
270
271
|
if (options.fabricExtensionPath) piArguments.push("-e", options.fabricExtensionPath);
|
|
271
272
|
if (options.writePolicy) {
|
|
272
|
-
if (
|
|
273
|
+
if (!isPi) throw new Error(`Write confinement requires the Pi runner, not ${options.runner}`);
|
|
273
274
|
const guard = import.meta.url.endsWith(".ts") ? "./agents/write-guard.ts" : "./agents/write-guard.js";
|
|
274
275
|
piArguments.push("-e", fileURLToPath(new URL(guard, import.meta.url)));
|
|
275
276
|
}
|
|
@@ -285,6 +286,14 @@ ${task}
|
|
|
285
286
|
${schema}`
|
|
286
287
|
);
|
|
287
288
|
}
|
|
289
|
+
if (options.runner === "pi-durable") {
|
|
290
|
+
piArguments.push(
|
|
291
|
+
"--durable-run-id",
|
|
292
|
+
options.id,
|
|
293
|
+
"--durable-directory",
|
|
294
|
+
path.join(path.dirname(options.statusFile), "durable")
|
|
295
|
+
);
|
|
296
|
+
}
|
|
288
297
|
const claudeCli = options.runner === "claude" ? await loadClaudeCli() : void 0;
|
|
289
298
|
const vedaCli = options.runner === "veda" ? await loadVedaCli() : void 0;
|
|
290
299
|
const childArguments = options.runner === "claude" ? claudeCli.buildClaudeArguments({
|
|
@@ -308,7 +317,10 @@ ${schema}`
|
|
|
308
317
|
// parallel Fabric agents never share Veda session state.
|
|
309
318
|
session: `fabric-${options.id}`
|
|
310
319
|
}) : piArguments;
|
|
311
|
-
const childBinary = options.runner === "claude" ? options.claudeBinary : options.runner === "veda" ? options.vedaBinary : options.
|
|
320
|
+
const childBinary = options.runner === "claude" ? options.claudeBinary : options.runner === "veda" ? options.vedaBinary : options.runner === "pi-durable" ? fileURLToPath(new URL(
|
|
321
|
+
import.meta.url.endsWith(".ts") ? "./durable/worker.ts" : "./durable/worker.js",
|
|
322
|
+
import.meta.url
|
|
323
|
+
)) : options.piBinary;
|
|
312
324
|
const child = spawnCli(childBinary, childArguments, {
|
|
313
325
|
cwd: options.cwd,
|
|
314
326
|
detached: process.platform !== "win32",
|
|
@@ -358,15 +370,19 @@ ${schema}`
|
|
|
358
370
|
let outputBuffer = "";
|
|
359
371
|
let vedaOutput = "";
|
|
360
372
|
let vedaParsed;
|
|
361
|
-
const eventProjection =
|
|
373
|
+
const eventProjection = isPi ? new PiEventProjection() : void 0;
|
|
362
374
|
const outputDecoder = new StringDecoder("utf8");
|
|
363
375
|
const stderrDecoder = new StringDecoder("utf8");
|
|
364
376
|
let terminalStatus;
|
|
365
377
|
let terminalError;
|
|
366
378
|
let sawAgentError = false;
|
|
367
379
|
let retryPending = false;
|
|
380
|
+
let answerProjected = false;
|
|
381
|
+
let recordedResultPending = false;
|
|
382
|
+
let recordedResultTimer;
|
|
383
|
+
const recordedResultId = `fabric-recorded-result:${options.id}`;
|
|
368
384
|
const update = () => updateRunRecord(options.statusFile, record);
|
|
369
|
-
const questionRelay = options.childQuestionTimeoutMs !== void 0 &&
|
|
385
|
+
const questionRelay = options.childQuestionTimeoutMs !== void 0 && isPi && options.steerFile ? new (await loadWorkerQuestions()).ChildQuestionRelay(options.childQuestionTimeoutMs, {
|
|
370
386
|
emit: (question) => emitLifecycle("question", { ...question }),
|
|
371
387
|
send: (frame) => child.stdin?.write(`${JSON.stringify(frame)}
|
|
372
388
|
`),
|
|
@@ -747,6 +763,58 @@ ${text}
|
|
|
747
763
|
processClaudeEvent(event);
|
|
748
764
|
return;
|
|
749
765
|
}
|
|
766
|
+
if (event.type === "response" && recordedResultPending && event.id === recordedResultId) {
|
|
767
|
+
recordedResultPending = false;
|
|
768
|
+
clearTimeout(recordedResultTimer);
|
|
769
|
+
const fail = (reason) => failStalledChild(`Durable recorded result retrieval failed: ${reason}`);
|
|
770
|
+
if (event.command !== "get_messages" || event.success !== true) {
|
|
771
|
+
fail(typeof event.error === "string" ? event.error : "invalid or rejected RPC response");
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
const data = event.data;
|
|
775
|
+
const messages = Array.isArray(data?.messages) ? data.messages : [];
|
|
776
|
+
const isMessage = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
777
|
+
let start = messages.length - 1;
|
|
778
|
+
while (start >= 0 && !(isMessage(messages[start]) && messages[start].role === "user")) start--;
|
|
779
|
+
if (start < 0 || extractText(messages[start]) !== task) {
|
|
780
|
+
fail("recorded history does not end with the submitted prompt");
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
const assistants = messages.slice(start + 1).filter(
|
|
784
|
+
(message) => isMessage(message) && message.role === "assistant"
|
|
785
|
+
);
|
|
786
|
+
const last = assistants.at(-1);
|
|
787
|
+
if (!last) {
|
|
788
|
+
fail("recorded prompt has no assistant result");
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
const restored = { ...record, usage: emptyUsage() };
|
|
792
|
+
for (const message of assistants) {
|
|
793
|
+
applyUsage(restored, message);
|
|
794
|
+
modelControl.observeAssistant(message);
|
|
795
|
+
}
|
|
796
|
+
if (terminalStatus) return;
|
|
797
|
+
for (const key of ["input", "output", "cacheRead", "cacheWrite", "cost"]) {
|
|
798
|
+
record.usage[key] = Math.max(record.usage[key], restored.usage[key]);
|
|
799
|
+
}
|
|
800
|
+
answerProjected = true;
|
|
801
|
+
record.text = latestRunText(extractText(last));
|
|
802
|
+
record.turns = Math.max(record.turns, assistants.length);
|
|
803
|
+
record.toolCalls = Math.max(record.toolCalls, messages.slice(start + 1).filter(
|
|
804
|
+
(message) => isMessage(message) && message.role === "toolResult"
|
|
805
|
+
).length);
|
|
806
|
+
if (last.stopReason === "error" || last.stopReason === "aborted") {
|
|
807
|
+
sawAgentError = true;
|
|
808
|
+
terminalError = assistantError(last);
|
|
809
|
+
}
|
|
810
|
+
enforceTokenLimit();
|
|
811
|
+
update();
|
|
812
|
+
if (!terminalStatus) {
|
|
813
|
+
pollSteer();
|
|
814
|
+
compactControl.childSettled();
|
|
815
|
+
}
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
750
818
|
compactControl.observe(event);
|
|
751
819
|
if (modelControl.observe(event)) return;
|
|
752
820
|
if (event.type === "message_start" || event.type === "message_update") {
|
|
@@ -836,6 +904,9 @@ ${text}
|
|
|
836
904
|
const messageRecord = message;
|
|
837
905
|
if (messageRecord.role !== "assistant") return;
|
|
838
906
|
const text = extractText(messageRecord);
|
|
907
|
+
if (text || messageRecord.stopReason === "error" || messageRecord.stopReason === "aborted") {
|
|
908
|
+
answerProjected = true;
|
|
909
|
+
}
|
|
839
910
|
if (text) {
|
|
840
911
|
record.text = latestRunText(text);
|
|
841
912
|
process.stdout.write(`
|
|
@@ -871,6 +942,17 @@ ${text}
|
|
|
871
942
|
if (event.type === "agent_settled") {
|
|
872
943
|
emitLifecycle("pi.agent_settled");
|
|
873
944
|
if (!retryPending) {
|
|
945
|
+
if (options.runner === "pi-durable" && !answerProjected && !terminalStatus) {
|
|
946
|
+
if (!recordedResultPending) {
|
|
947
|
+
recordedResultPending = true;
|
|
948
|
+
recordedResultTimer = setTimeout(() => failStalledChild(
|
|
949
|
+
"Durable recorded result retrieval timed out waiting for get_messages"
|
|
950
|
+
), KILL_GRACE_MS);
|
|
951
|
+
child.stdin?.write(`${JSON.stringify({ type: "get_messages", id: recordedResultId })}
|
|
952
|
+
`);
|
|
953
|
+
}
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
874
956
|
pollSteer();
|
|
875
957
|
compactControl.childSettled();
|
|
876
958
|
}
|
|
@@ -917,7 +999,7 @@ ${schema}`
|
|
|
917
999
|
let steerRemainder = Buffer.alloc(0);
|
|
918
1000
|
let skippingOversizedSteerLine = false;
|
|
919
1001
|
const pollSteer = () => {
|
|
920
|
-
if (!options.steerFile || terminalStatus ||
|
|
1002
|
+
if (!options.steerFile || terminalStatus || isPi && !modelControl.ready) return;
|
|
921
1003
|
let descriptor;
|
|
922
1004
|
try {
|
|
923
1005
|
descriptor = fs2.openSync(options.steerFile, "r");
|
|
@@ -1066,7 +1148,7 @@ ${schema}`
|
|
|
1066
1148
|
if (terminalStatus) return;
|
|
1067
1149
|
terminalStatus = "timed_out";
|
|
1068
1150
|
terminalError = `Agent timed out after ${options.timeoutMs}ms`;
|
|
1069
|
-
if (
|
|
1151
|
+
if (isPi && !modelControl.ready) {
|
|
1070
1152
|
terminalError += "; Pi model admission did not complete; task was not sent";
|
|
1071
1153
|
}
|
|
1072
1154
|
killChild();
|
|
@@ -1090,6 +1172,11 @@ ${schema}`
|
|
|
1090
1172
|
child.once("close", (code) => resolve(code));
|
|
1091
1173
|
});
|
|
1092
1174
|
if (steerTimer) clearInterval(steerTimer);
|
|
1175
|
+
clearTimeout(recordedResultTimer);
|
|
1176
|
+
if (recordedResultPending && !terminalStatus) {
|
|
1177
|
+
terminalStatus = "failed";
|
|
1178
|
+
terminalError = "Durable worker exited before recorded result retrieval completed";
|
|
1179
|
+
}
|
|
1093
1180
|
questionRelay?.close();
|
|
1094
1181
|
delete record.blockedOn;
|
|
1095
1182
|
if (claudeCloseTimer) clearTimeout(claudeCloseTimer);
|
|
@@ -1097,7 +1184,7 @@ ${schema}`
|
|
|
1097
1184
|
if (killTimer) clearTimeout(killTimer);
|
|
1098
1185
|
if (closeTimer) clearTimeout(closeTimer);
|
|
1099
1186
|
recoveryWatchdog.dispose();
|
|
1100
|
-
if (
|
|
1187
|
+
if (isPi && !modelControl.ready && !terminalStatus) {
|
|
1101
1188
|
terminalStatus = "failed";
|
|
1102
1189
|
terminalError = `Child Pi exited before requested model admission completed; task was not sent${stderr.trim() ? `: ${stderr.trim()}` : ""}`;
|
|
1103
1190
|
}
|
|
@@ -1177,7 +1264,7 @@ ${text}
|
|
|
1177
1264
|
}
|
|
1178
1265
|
record.finishedAt = Date.now();
|
|
1179
1266
|
record.updatedAt = record.finishedAt;
|
|
1180
|
-
const childCompleted = exitCode === 0 && !sawAgentError && (
|
|
1267
|
+
const childCompleted = exitCode === 0 && !sawAgentError && (isPi || options.runner === "claude" && claudeResultSeen && claudeSentInputs.length === 0 && claudeSteering.length === 0 && claudeFollowUps.length === 0 || options.runner === "veda" && vedaParsed !== void 0);
|
|
1181
1268
|
record.status = terminalStatus ?? (childCompleted ? "completed" : "failed");
|
|
1182
1269
|
if (terminalError) record.error = terminalError;
|
|
1183
1270
|
if (record.status === "failed" && !record.error) {
|