@tangle-network/agent-runtime 0.236.0 → 0.238.0
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/{activation-i0X3nbzs.js → activation-Br1FRlyB.js} +2 -2
- package/dist/{activation-i0X3nbzs.js.map → activation-Br1FRlyB.js.map} +1 -1
- package/dist/{activation-BRI-PlIJ.d.ts → activation-CRDZUoUE.d.ts} +2 -2
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-CVJVrk2v.js → coordination-driver-DbiCH5be.js} +52 -25
- package/dist/coordination-driver-DbiCH5be.js.map +1 -0
- package/dist/{delegate-DZzAL4Wm.js → delegate-C4rLxuv8.js} +2 -2
- package/dist/{delegate-DZzAL4Wm.js.map → delegate-C4rLxuv8.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +26 -37
- package/dist/durable.js.map +1 -1
- package/dist/{graph-BaE-P5QS.js → graph-BHU73FnA.js} +3 -3
- package/dist/{graph-BaE-P5QS.js.map → graph-BHU73FnA.js.map} +1 -1
- package/dist/{improvement-cycle-2RWFyW4D.js → improvement-cycle-DkzbEzS5.js} +3 -3
- package/dist/{improvement-cycle-2RWFyW4D.js.map → improvement-cycle-DkzbEzS5.js.map} +1 -1
- package/dist/{index-CEWz0yNr.d.ts → index-B8Fmz26p.d.ts} +4 -4
- package/dist/index.d.ts +6 -6
- package/dist/index.js +8 -16
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +3 -3
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +8 -8
- package/dist/{loop-runner-bin-hloQ3MT_.js → loop-runner-bin-BaQIyvh-.js} +3 -3
- package/dist/{loop-runner-bin-hloQ3MT_.js.map → loop-runner-bin-BaQIyvh-.js.map} +1 -1
- package/dist/{loop-runner-bin-tPYqizeb.d.ts → loop-runner-bin-vGFnPXLM.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +5 -5
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-DcJtr_0L.d.ts → openai-tools-BPPAXxP2.d.ts} +2 -2
- package/dist/profiles.d.ts +2 -2
- package/dist/{provision-supervisor-CfT7yEeg.js → provision-supervisor-Briw5tX4.js} +3 -3
- package/dist/{provision-supervisor-CfT7yEeg.js.map → provision-supervisor-Briw5tX4.js.map} +1 -1
- package/dist/{runtime-DqxluIn_.js → runtime-BzGKUqqY.js} +11 -20
- package/dist/runtime-BzGKUqqY.js.map +1 -0
- package/dist/{server-BNsUopoF.js → server-CDn-i_GJ.js} +3 -3
- package/dist/{server-BNsUopoF.js.map → server-CDn-i_GJ.js.map} +1 -1
- package/dist/{stream-agent-turn-BYupQNrs.d.ts → stream-agent-turn-xgmm-M55.d.ts} +2 -2
- package/dist/{structural-rollout-C6FsCpeq.js → structural-rollout-B-EAO8C5.js} +2 -2
- package/dist/{structural-rollout-C6FsCpeq.js.map → structural-rollout-B-EAO8C5.js.map} +1 -1
- package/dist/{substrate-C7ivCM2O.d.ts → substrate-B_9stFWH.d.ts} +2 -2
- package/dist/{supervise-mvykoSSc.js → supervise-Dc2DjlZS.js} +30 -15
- package/dist/supervise-Dc2DjlZS.js.map +1 -0
- package/dist/{supervisor-DGsHiL1-.js → supervisor-BN3oMv_v.js} +158 -64
- package/dist/supervisor-BN3oMv_v.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-DANs9CAb.d.ts → types-CE7ES_TD.d.ts} +28 -5
- package/package.json +1 -1
- package/dist/coordination-driver-CVJVrk2v.js.map +0 -1
- package/dist/runtime-DqxluIn_.js.map +0 -1
- package/dist/supervise-mvykoSSc.js.map +0 -1
- package/dist/supervisor-DGsHiL1-.js.map +0 -1
|
@@ -2365,22 +2365,66 @@ function providerAttemptEvidence(model) {
|
|
|
2365
2365
|
}
|
|
2366
2366
|
//#endregion
|
|
2367
2367
|
//#region src/durable/jsonl-file.ts
|
|
2368
|
-
/**
|
|
2369
|
-
* A
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
const
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2368
|
+
/** Read a fixed file prefix one record at a time, never allocating the whole journal as a string.
|
|
2369
|
+
* A reader cannot chase concurrent appends forever. Missing files are empty only when requested;
|
|
2370
|
+
* corruption, short reads, and other I/O errors remain failures. Closing the iterator closes the fd. */
|
|
2371
|
+
async function* readCommittedJsonLines(path, options = {}) {
|
|
2372
|
+
const fs = await import("node:fs/promises");
|
|
2373
|
+
let handle;
|
|
2374
|
+
try {
|
|
2375
|
+
handle = await fs.open(path, "r");
|
|
2376
|
+
} catch (error) {
|
|
2377
|
+
if (options.allowMissing && isNoEntError(error)) return;
|
|
2378
|
+
throw error;
|
|
2379
|
+
}
|
|
2380
|
+
try {
|
|
2381
|
+
const { size } = await handle.stat();
|
|
2382
|
+
if (size === 0) return;
|
|
2383
|
+
const { StringDecoder } = await import("node:string_decoder");
|
|
2384
|
+
const decoder = new StringDecoder("utf8");
|
|
2385
|
+
const stream = handle.createReadStream({
|
|
2386
|
+
autoClose: false,
|
|
2387
|
+
end: size - 1
|
|
2388
|
+
});
|
|
2389
|
+
const fragments = [];
|
|
2390
|
+
let lineNumber = 1;
|
|
2376
2391
|
try {
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2392
|
+
for await (const chunk of stream) {
|
|
2393
|
+
options.onBytes?.(chunk);
|
|
2394
|
+
const text = decoder.write(chunk);
|
|
2395
|
+
let start = 0;
|
|
2396
|
+
let end = text.indexOf("\n", start);
|
|
2397
|
+
while (end !== -1) {
|
|
2398
|
+
fragments.push(text.slice(start, end));
|
|
2399
|
+
const record = parseRecord(fragments.join(""), path, lineNumber++, true);
|
|
2400
|
+
fragments.length = 0;
|
|
2401
|
+
if (record !== void 0) yield record.value;
|
|
2402
|
+
start = end + 1;
|
|
2403
|
+
end = text.indexOf("\n", start);
|
|
2404
|
+
}
|
|
2405
|
+
if (start < text.length) fragments.push(text.slice(start));
|
|
2406
|
+
}
|
|
2407
|
+
if (stream.bytesRead !== size) throw new Error(`${path}: journal changed while reading its committed prefix`);
|
|
2408
|
+
fragments.push(decoder.end());
|
|
2409
|
+
const record = parseRecord(fragments.join(""), path, lineNumber, false);
|
|
2410
|
+
if (record !== void 0) yield record.value;
|
|
2411
|
+
} finally {
|
|
2412
|
+
stream.destroy();
|
|
2381
2413
|
}
|
|
2414
|
+
} finally {
|
|
2415
|
+
await handle.close();
|
|
2416
|
+
}
|
|
2417
|
+
}
|
|
2418
|
+
/** An invalid unterminated tail may be a torn write; other parse failures are not evidence of one. */
|
|
2419
|
+
function parseRecord(line, source, lineNumber, terminated) {
|
|
2420
|
+
if (line.length === 0) return void 0;
|
|
2421
|
+
try {
|
|
2422
|
+
return { value: JSON.parse(line) };
|
|
2423
|
+
} catch (cause) {
|
|
2424
|
+
if (!(cause instanceof SyntaxError)) throw cause;
|
|
2425
|
+
if (!terminated) return void 0;
|
|
2426
|
+
throw new Error(`${source}: malformed JSONL record at line ${lineNumber}`, { cause });
|
|
2382
2427
|
}
|
|
2383
|
-
return records;
|
|
2384
2428
|
}
|
|
2385
2429
|
/** FileHandle.write may legally make a short write. Loop until every byte is appended. */
|
|
2386
2430
|
async function writeAllBytes(handle, value) {
|
|
@@ -8083,7 +8127,8 @@ async function* streamProviderExecutor(args) {
|
|
|
8083
8127
|
settled = {
|
|
8084
8128
|
...result.outcome?.status === "failed" ? { outcome: {
|
|
8085
8129
|
success: false,
|
|
8086
|
-
...result.outcome.error ? { error: result.outcome.error } : {}
|
|
8130
|
+
...result.outcome.error ? { error: result.outcome.error } : {},
|
|
8131
|
+
...result.outcome.errorCode ? { errorCode: result.outcome.errorCode } : {}
|
|
8087
8132
|
} } : {},
|
|
8088
8133
|
outRef: contentRef$1(`provider:${args.provider.name}`, result),
|
|
8089
8134
|
out: result,
|
|
@@ -13292,12 +13337,20 @@ function priceUnreceiptedWork(work) {
|
|
|
13292
13337
|
const outcomeSchema = AgentTurnResultSchema.pick({
|
|
13293
13338
|
success: true,
|
|
13294
13339
|
error: true
|
|
13295
|
-
}).strict();
|
|
13340
|
+
}).extend({ errorCode: AgentTurnResultSchema.shape.error }).strict();
|
|
13296
13341
|
/** Read only the executor envelope; application output and grades are not execution status. */
|
|
13297
|
-
function
|
|
13342
|
+
function executorFailure(result) {
|
|
13298
13343
|
if (result.outcome === void 0) return void 0;
|
|
13299
13344
|
const outcome = outcomeSchema.parse(result.outcome);
|
|
13300
|
-
|
|
13345
|
+
if (outcome.success) return void 0;
|
|
13346
|
+
return {
|
|
13347
|
+
error: outcome.error ?? "Agent execution failed",
|
|
13348
|
+
...outcome.errorCode === void 0 ? {} : { errorCode: outcome.errorCode }
|
|
13349
|
+
};
|
|
13350
|
+
}
|
|
13351
|
+
/** The failure text alone, for callers that record a settlement reason. */
|
|
13352
|
+
function executorFailureReason(result) {
|
|
13353
|
+
return executorFailure(result)?.error;
|
|
13301
13354
|
}
|
|
13302
13355
|
/** Preserve deterministic result pointers across built-in executors and replay.
|
|
13303
13356
|
* FNV-1a is an identity convention here, not a cryptographic integrity check. */
|
|
@@ -15083,34 +15136,37 @@ function createBudgetPool(root, runStartedAtMs, restore = {}) {
|
|
|
15083
15136
|
const wanted = b.resources?.[name];
|
|
15084
15137
|
if (!wanted) throw new ValidationError$1(`resource ${name}: child must declare its limit`);
|
|
15085
15138
|
if (wanted.unit !== state.unit) throw new ValidationError$1(`resource ${name}: unit mismatch`);
|
|
15086
|
-
if (!state.known || wanted.limit > state.remaining) return {
|
|
15087
|
-
ok: false,
|
|
15088
|
-
reason: "budget-exhausted"
|
|
15089
|
-
};
|
|
15090
15139
|
}
|
|
15091
15140
|
for (const name of Object.keys(b.resources ?? {})) if (!resources.has(name)) throw new ValidationError$1(`resource ${name}: root must declare its limit`);
|
|
15092
15141
|
const wantTokens = b.maxTokens;
|
|
15093
15142
|
const wantUsd = b.maxUsd ?? 0;
|
|
15094
15143
|
const wantIterations = b.maxIterations;
|
|
15095
|
-
|
|
15096
|
-
|
|
15097
|
-
|
|
15098
|
-
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
if (wantIterations > freeIterations) return {
|
|
15104
|
-
ok: false,
|
|
15105
|
-
reason: "budget-exhausted"
|
|
15144
|
+
const shortfalls = [];
|
|
15145
|
+
const short = (channel, requested, free, closedByUnknownSpend = false) => {
|
|
15146
|
+
shortfalls.push({
|
|
15147
|
+
channel,
|
|
15148
|
+
requested,
|
|
15149
|
+
free: closedByUnknownSpend ? 0 : Math.max(0, free),
|
|
15150
|
+
...closedByUnknownSpend ? { closedByUnknownSpend: true } : {}
|
|
15151
|
+
});
|
|
15106
15152
|
};
|
|
15107
|
-
|
|
15153
|
+
for (const [name, state] of resources) {
|
|
15154
|
+
const limit = b.resources[name].limit;
|
|
15155
|
+
if (!state.known) short(`resource:${name}`, limit, 0, true);
|
|
15156
|
+
else if (limit > state.remaining) short(`resource:${name}`, limit, state.remaining);
|
|
15157
|
+
}
|
|
15158
|
+
if (usdCapped && usdTainted) short("usd", wantUsd, 0, true);
|
|
15159
|
+
if (wantTokens > freeTokens) short("tokens", wantTokens, freeTokens);
|
|
15160
|
+
if (wantIterations > freeIterations) short("iterations", wantIterations, freeIterations);
|
|
15161
|
+
if (shortfalls.length === 0 && wantUsd > 0 && !usdCapped) return {
|
|
15108
15162
|
ok: false,
|
|
15109
15163
|
reason: "usd-unbudgeted"
|
|
15110
15164
|
};
|
|
15111
|
-
if (wantUsd > freeUsd)
|
|
15165
|
+
if (usdCapped && !usdTainted && wantUsd > freeUsd) short("usd", wantUsd, freeUsd);
|
|
15166
|
+
if (shortfalls.length > 0) return {
|
|
15112
15167
|
ok: false,
|
|
15113
|
-
reason: "budget-exhausted"
|
|
15168
|
+
reason: "budget-exhausted",
|
|
15169
|
+
shortfalls
|
|
15114
15170
|
};
|
|
15115
15171
|
for (const [name, state] of resources) {
|
|
15116
15172
|
const amount = b.resources[name].limit;
|
|
@@ -15569,18 +15625,10 @@ var FileSpawnJournal = class {
|
|
|
15569
15625
|
this.path = path;
|
|
15570
15626
|
}
|
|
15571
15627
|
async loadTree(root) {
|
|
15572
|
-
const fs = await import("node:fs/promises");
|
|
15573
|
-
let text;
|
|
15574
|
-
try {
|
|
15575
|
-
text = await fs.readFile(this.path, "utf8");
|
|
15576
|
-
} catch (err) {
|
|
15577
|
-
if (isNoEntError(err)) return void 0;
|
|
15578
|
-
throw err;
|
|
15579
|
-
}
|
|
15580
15628
|
let begun = false;
|
|
15581
15629
|
const events = [];
|
|
15582
15630
|
const index = new SpawnEventIndex(root);
|
|
15583
|
-
for (const record of
|
|
15631
|
+
for await (const record of readCommittedJsonLines(this.path, { allowMissing: true })) {
|
|
15584
15632
|
if (record.root !== root) continue;
|
|
15585
15633
|
if (record.kind === "begin") begun = true;
|
|
15586
15634
|
else {
|
|
@@ -15627,26 +15675,22 @@ var FileSpawnJournal = class {
|
|
|
15627
15675
|
});
|
|
15628
15676
|
}
|
|
15629
15677
|
async validationIndex() {
|
|
15630
|
-
const fs = await import("node:fs/promises");
|
|
15631
15678
|
const stamp = await this.fileStamp();
|
|
15632
15679
|
if (this.appendIndex && this.appendIndex.stamp === stamp) return this.appendIndex;
|
|
15633
15680
|
this.appendIndex = void 0;
|
|
15634
15681
|
const trees = /* @__PURE__ */ new Map();
|
|
15635
|
-
if (stamp !== void 0) {
|
|
15636
|
-
|
|
15637
|
-
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
if (!tree) throw new Error(`spawn journal corrupted: event for tree '${record.root}' precedes its begin record`);
|
|
15646
|
-
tree.index.assert(record.event);
|
|
15647
|
-
tree.index.add(record.event);
|
|
15648
|
-
}
|
|
15682
|
+
if (stamp !== void 0) for await (const record of readCommittedJsonLines(this.path)) if (record.kind === "begin") {
|
|
15683
|
+
if (!trees.has(record.root)) trees.set(record.root, {
|
|
15684
|
+
begunAt: record.at,
|
|
15685
|
+
index: new SpawnEventIndex(record.root)
|
|
15686
|
+
});
|
|
15687
|
+
} else {
|
|
15688
|
+
const tree = trees.get(record.root);
|
|
15689
|
+
if (!tree) throw new Error(`spawn journal corrupted: event for tree '${record.root}' precedes its begin record`);
|
|
15690
|
+
tree.index.assert(record.event);
|
|
15691
|
+
tree.index.add(record.event);
|
|
15649
15692
|
}
|
|
15693
|
+
if (await this.fileStamp() !== stamp) throw new Error("spawn journal changed while rebuilding its append index");
|
|
15650
15694
|
this.appendIndex = {
|
|
15651
15695
|
stamp,
|
|
15652
15696
|
trees
|
|
@@ -19055,6 +19099,9 @@ function errorProperty(error, field) {
|
|
|
19055
19099
|
return `[unreadable error ${field}]`;
|
|
19056
19100
|
}
|
|
19057
19101
|
}
|
|
19102
|
+
/** An HTTP status carried on a thrown error, read without trusting its getter. Provider SDKs put
|
|
19103
|
+
* one on their own error classes, so this is how a refusal is recognised outside the transport
|
|
19104
|
+
* taxonomy — for the persisted message here, and for the driver's retry verdict. */
|
|
19058
19105
|
function errorHttpStatus(error) {
|
|
19059
19106
|
try {
|
|
19060
19107
|
const status = Reflect.get(error, "status");
|
|
@@ -21067,7 +21114,8 @@ function createScope(args) {
|
|
|
21067
21114
|
permit.release();
|
|
21068
21115
|
return {
|
|
21069
21116
|
ok: false,
|
|
21070
|
-
reason: reservation.reason
|
|
21117
|
+
reason: reservation.reason,
|
|
21118
|
+
...reservation.shortfalls === void 0 ? {} : { shortfalls: reservation.shortfalls }
|
|
21071
21119
|
};
|
|
21072
21120
|
}
|
|
21073
21121
|
let spec;
|
|
@@ -23365,7 +23413,9 @@ function unreportedSpend(total, prior) {
|
|
|
23365
23413
|
* so retrying re-runs a decision rather than recovering from an accident. They fail immediately.
|
|
23366
23414
|
* - TRANSIENT failures are everything foreign: a harness process that exited without a reason, a
|
|
23367
23415
|
* stream that cut mid-turn, a 5xx, a socket reset. Those are accidents, and they are exactly
|
|
23368
|
-
* what a retry exists for.
|
|
23416
|
+
* what a retry exists for. A harness turn that RETURNED a failed outcome is the same accident
|
|
23417
|
+
* reported as a value rather than thrown, so the drive raises {@link HarnessTurnFailedError}
|
|
23418
|
+
* and it is classified here like any other failure.
|
|
23369
23419
|
*
|
|
23370
23420
|
* The one loop the budget alone cannot bound is a driver that dies INSTANTLY and repeatedly — a
|
|
23371
23421
|
* dead-on-arrival credential, a harness that refuses to start. Spending nothing, it would retry
|
|
@@ -23427,6 +23477,28 @@ const DETERMINISTIC_BRIDGE_CODES = /* @__PURE__ */ new Set([
|
|
|
23427
23477
|
"capability_denied"
|
|
23428
23478
|
]);
|
|
23429
23479
|
/**
|
|
23480
|
+
* A driver's harness turn ran to its terminal result, and that result reported failure.
|
|
23481
|
+
*
|
|
23482
|
+
* A provider executor reports a failed turn as a returned outcome, not a thrown error, so without
|
|
23483
|
+
* this error a failed turn reads as a completed drive and never reaches the retry decision.
|
|
23484
|
+
* Measured 2026-09-17 on a Discovery director placed on tangle-sandbox with the opencode harness:
|
|
23485
|
+
* a 53-minute turn ended `status code 524`, and another ended `Invalid API key` after a platform
|
|
23486
|
+
* key expired mid-turn. A new turn succeeds in both cases.
|
|
23487
|
+
*
|
|
23488
|
+
* `errorCode` is the provider's machine code when it reported one. The classifier reads the code
|
|
23489
|
+
* and never the text, because the text is written for people and changes without notice.
|
|
23490
|
+
*/
|
|
23491
|
+
var HarnessTurnFailedError = class extends Error {
|
|
23492
|
+
runtime;
|
|
23493
|
+
errorCode;
|
|
23494
|
+
constructor(runtime, failure) {
|
|
23495
|
+
super(`${runtime} harness turn ended with a failed outcome` + (failure.errorCode === void 0 ? "" : ` (${failure.errorCode})`) + `: ${failure.error}`);
|
|
23496
|
+
this.name = "HarnessTurnFailedError";
|
|
23497
|
+
this.runtime = runtime;
|
|
23498
|
+
if (failure.errorCode !== void 0) this.errorCode = failure.errorCode;
|
|
23499
|
+
}
|
|
23500
|
+
};
|
|
23501
|
+
/**
|
|
23430
23502
|
* Classify one driver failure. Runtime's own typed refusals are decisions and stay terminal;
|
|
23431
23503
|
* anything foreign is an accident and is retryable. A `BackendTransportError` is split by status
|
|
23432
23504
|
* because the taxonomy already promises consumers may branch on it: a 5xx/429/408 is the upstream
|
|
@@ -23436,6 +23508,7 @@ const DETERMINISTIC_BRIDGE_CODES = /* @__PURE__ */ new Set([
|
|
|
23436
23508
|
function classifyDriverFailure(error, signal) {
|
|
23437
23509
|
if (signal?.aborted) return "terminal";
|
|
23438
23510
|
if (error instanceof Error && errorProperty(error, "name") === "AbortError") return "terminal";
|
|
23511
|
+
if (error instanceof HarnessTurnFailedError) return error.errorCode !== void 0 && DETERMINISTIC_BRIDGE_CODES.has(error.errorCode) ? "terminal" : "transient";
|
|
23439
23512
|
if (error instanceof BackendTransportError) {
|
|
23440
23513
|
if (error.upstreamCode !== void 0 && DETERMINISTIC_BRIDGE_CODES.has(error.upstreamCode)) return "terminal";
|
|
23441
23514
|
const status = error.status;
|
|
@@ -23445,7 +23518,28 @@ function classifyDriverFailure(error, signal) {
|
|
|
23445
23518
|
}
|
|
23446
23519
|
if (error instanceof ValidationError$1 || error instanceof ConfigError || error instanceof RuntimeRunStateError) return "terminal";
|
|
23447
23520
|
if (error instanceof AgentEvalError$1) return "terminal";
|
|
23448
|
-
return "transient";
|
|
23521
|
+
return foreignHttpStatusVerdict(error) ?? "transient";
|
|
23522
|
+
}
|
|
23523
|
+
/**
|
|
23524
|
+
* A foreign error that still carries an HTTP status is a refusal we can read.
|
|
23525
|
+
*
|
|
23526
|
+
* A provider SDK throws its own error classes, so an environment `create` that the platform
|
|
23527
|
+
* refused arrives here as neither a `BackendTransportError` nor an `AgentEvalError`, and the
|
|
23528
|
+
* default sends it to `transient`. Measured 2026-09-16: a Tangle Sandbox create refused
|
|
23529
|
+
* `HTTP 400 {"code":"CONFIG_ERROR"}` for a key whose budget was fully reserved retried 14-22
|
|
23530
|
+
* times per node while the run showed a durable intent and no other event, so eleven of twelve
|
|
23531
|
+
* roots sat for 25 minutes with nothing to diagnose. The status was on the error the whole time.
|
|
23532
|
+
*
|
|
23533
|
+
* Reading it applies the same rule the transport branch already promises consumers: 408, 429 and
|
|
23534
|
+
* 5xx are the upstream having a bad moment, and any other 4xx is a request that will fail
|
|
23535
|
+
* identically forever. Anything without a plain numeric status keeps the historical default.
|
|
23536
|
+
*/
|
|
23537
|
+
function foreignHttpStatusVerdict(error) {
|
|
23538
|
+
if (!(error instanceof Error)) return void 0;
|
|
23539
|
+
const status = errorHttpStatus(error);
|
|
23540
|
+
if (status === void 0 || status < 400) return void 0;
|
|
23541
|
+
if (status === 408 || status === 429 || status >= 500) return "transient";
|
|
23542
|
+
return "terminal";
|
|
23449
23543
|
}
|
|
23450
23544
|
/** The budget's own verdict on whether another attempt may run at all. */
|
|
23451
23545
|
function budgetStop(budget, atMs) {
|
|
@@ -24566,6 +24660,6 @@ function isNonEmptySpend(s) {
|
|
|
24566
24660
|
return s.iterations > 0 || s.tokens.input > 0 || s.tokens.output > 0 || s.usd > 0 || s.ms > 0 || s.tokensKnown === false || s.usdKnown === false || Object.values(s.resources ?? {}).some((resource) => resource.amount > 0 || !resource.known);
|
|
24567
24661
|
}
|
|
24568
24662
|
//#endregion
|
|
24569
|
-
export {
|
|
24663
|
+
export { rollingDispatch as $, promptFromAgentTurnInput as $i, buildLoopOtelSpans as $n, knownMaterializationReceipt as $r, bridgeAdmissionRefusal as $t, validateWaitSpec as A, chargedTokens as Ai, registerRetainedExecutorPreparation as An, defineProfileMaterializationContract as Ar, spendFromUsageEvents as At, workerInteractiveAdmissionFile as B, throwIfAborted as Bi, retainedCreateMaterial as Bn, unsupportedProfileDimensions as Br, readWorkerProgress as Bt, restoreScopeOwnerAcceptedExecution as C, mapSandboxEvent as Ci, providerAsExecutor as Cn, harnessSupportsReasoningEffort as Cr, parseWorkerToolTraceArtifact as Ct, isWaitOutcome as D, sandboxProgressEvents as Di, createPushTraceSource as Dn, AGENT_PROFILE_MATERIALIZATION_AXES as Dr, createBudgetPool as Dt, createWaitProbes as E, sandboxEventServedBackend as Ei, sandboxClientAsProvider as En, CodexExecutionDiagnosticError as Er, assertValidBudget as Et, scopeRetainedOwnerContext as F, promptCacheTokenClasses as Fi, runAbortable as Fn, promptOnlyProfileMaterialization as Fr, workerTraceHeaders as Ft, reconnectRetainedInteractiveRun as G, resourceTelemetry as Gi, harnessTranscriptArtifact as Gn, readCommittedJsonLines as Gr, claimsAuthority as Gt, readWorkerInteractiveBinding as H, withTimeout as Hi, defaultRedactorIdentityMaterial as Hn, worktreeCliProfileMaterialization as Hr, AUTHORITY_MARKERS as Ht, scopeRetainedOwnerPriorSpend as I, randomSuffix as Ii, reconnectRetainedRun as In, promptResourceProfileMaterialization as Ir, workerTraceSeamKey as It, destroyInteractiveEnvironment as J, abortError$2 as Ji, createPropagatingTraceEmitter as Jn, attestRuntimeOwnedScopeOwner as Jr, peerMailTools as Jt, recoverRetainedInteractiveRun as K, withBudgetResources as Ki, persistHarnessTranscript as Kn, writeAllBytes as Kr, createPeerMailbox as Kt, scopeRetainedOwnerResult as L, sleep as Li, recoverRetainedRun as Ln, renderProfileMaterializationIssues as Lr, taskToPrompt as Lt, bindScopeRetainedOwnerProvider as M, deleteBoxSafe as Mi, RunCancellationReason as Mn, profileMaterializationAxes$1 as Mr, WORKER_TRACE_PROPAGATION as Mt, consumeScopeRetainedOwnerResult as N, hasCompleteCacheBreakdown as Ni, abortError as Nn, promptControlProfileMaterialization as Nr, readWorkerTraceContext as Nt, pollFor as O, sumSandboxUsage as Oi, decodeToolPart as On, assertProfileMaterialization as Or, meterUsageEvent as Ot, prepareScopeRetainedOwnerTask as P, isAbortError$2 as Pi, linkAbort as Pn, promptModelProfileMaterialization as Pr, workerTraceEnv as Pt, queueOf as Q, teardownExecutor as Qi, INTELLIGENCE_WIRE_VERSION as Qn, knownExecutionBindingReceipt as Qr, executorFailure as Qt, interactiveAdmissionSeamKey as R, stringifySafe as Ri, startRetainedRun as Rn, renderUnsupported as Rr, DEFAULT_STALL_AFTER_MS as Rt, recordScopeOwnerMaterialization as S, isSandboxTerminalEvent as Si, createAgentEnvironmentProviderRegistry as Sn, LOCAL_HARNESSES as Sr, isTraceAnalysisStore as St, settledToIteration as T, notifySandboxEventObserver as Ti, resolveAgentEnvironmentProvider as Tn, parseCodexTokenUsage as Tr, BudgetReconcileFault as Tt, workerInteractiveBindingFile as U, zeroSpend as Ui, resolveRedactor as Un, isNoEntError as Ur, DEFAULT_PEER_MAIL_LIMITS as Ut, attachWorker as V, unmeteredSpend as Vi, defaultRedactor as Vn, validateProfileMaterialization as Vr, createInbox as Vt, workerInteractiveBindingsDir as W, addResourceSpend as Wi, captureHarnessTranscript as Wn, prepareJsonlAppend as Wr, PEER_MAIL_WIRE_KEY as Wt, effectiveConcurrency as X, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as Xi, readTraceContextFromEnv as Xn, finalizeRuntimeOwnedPendingExecutor as Xr, isLiveNodeStatus as Xt, errMessage as Y, awaitAbortable$1 as Yi, mergeTraceEnv as Yn, authoredProfileDigest as Yr, peerMailVerbNames as Yt, freeSlots as Z, armDeadlineTimer as Zi, traceContextToEnv as Zn, inheritRuntimeOwnedExecutorAttestation as Zr, isTerminalNodeStatus as Zt, beginScopeOwnerAttempt as _, assertSandboxServedModel as _i, routerBrain as _n, runWorktreeHarness as _r, materializeTreeView as _t, pickBestDelivered as a, runtimeOwnedExecutorMaterialization as ai, bridgeRuntimeAttachmentsKey as an, flatOtelSpan as ar, createExecutorRegistry as at, meterRuntimeOwnedAccounting as b, createSandboxUsageLedger as bi, observedModelMatchesDeclared as bn, removeWorktree as br, WORKER_TOOL_TRACE_SCHEMA_VERSION as bt, DriverAttemptsExhaustedError as c, runtimeOwnedScopeOwnerRuntime as ci, createSandboxForSpec as cn, padSpanId as cr, DEFAULT_SANDBOX_STEERING_MAX_TURNS as ct, defaultUnmetContractSteer as d, executableAgentProfileSnapshot as di, runAgentRounds as dn, createRuntimeEventCollector as dr, FileResultBlobStore as dt, promptOptionsFromAgentTurnInput as ea, newExecutionAttemptId as ei, bridgeModelRouteRefusal as en, buildLoopSpanNodes as er, bindReusableExecutorExecutionId as et, runDriverWithRetry as f, executableAgentSpecSnapshot as fi, createSandboxLineage as fn, createRuntimeStreamEventCollector as fr, FileSpawnJournal as ft, withDriverExecutor as g, readSandboxOutcome as gi, readPromptOptions as gn, runSettledCommand as gr, loadSpawnForest as gt, isDriverSpec as h, projectSandboxOutcome as hi, assertBoxlessPromptOptions as hn, sanitizeRuntimeStreamEvent as hr, insideCursorNamespace as ht, collectDelivered as i, runtimeOwnedExecutorExecutionBinding as ii, readCodexRolloutSession as in, exportEvalRuns as ir, createExecutor as it, waitUntil as j, cloneSpend as ji, retainedExecutorSeamKey as jn, fullProfileMaterialization as jr, spendFromUsageTotals as jt, timerAt as k, addSpend as ki, sandboxSessionTraceSource as kn, controlProfileMaterialization as kr, newUsageTotals as kt, HarnessTurnFailedError as l, unknownExecutionBindingReceipt as li, defaultSelectWinner as ln, padTraceId as lr, createSteerableSandboxSession as lt, driverExecutorFactory as m, detachedSnapshot as mi, acquireSandbox as mn, sanitizeKnowledgeReadinessReport as mr, InMemorySpawnJournal as mt, createSupervisor as n, recordRuntimeOwnedDriveHarnessProviderEvidence as ni, createCodexRolloutStoreReader as nn, createOpenInferenceFileExporter as nr, cliInPlaceExecutor as nt, runFinalizer as o, runtimeOwnedExecutorProviderEvidence as oi, bridgeStopSignalKey as on, generateSpanId as or, snapshotExecutorConfig as ot, driverChild as p, detachedFrozen as pi, probeSandboxCapabilities as pn, sanitizeAgentRuntimeEvent as pr, InMemoryResultBlobStore as pt, startRetainedInteractiveRun as q, decodeHarnessUsage as qi, contentAddress as qn, attestRuntimeOwnedPendingExecutor as qr, isPeerMailEnvelope as qt, bestDelivered as r, runtimeOwnedDriveHarnessProviderEvidence as ri, harnessUsageIsEmpty as rn, createOtelExporter as rr, cliWorktreeExecutor as rt, runTree as s, runtimeOwnedPendingExecutorMaterialization as si, TERMINAL_DECISIONS as sn, loopEventToOtelSpan as sr, createWorktreeCliExecutor as st, createRootHandle as t, providerMessageText as ta, providerAttemptEvidence as ti, addHarnessUsage as tn, buildRuntimeEventOtelSpans as tr, captureReusableExecutorConfig as tt, classifyDriverFailure as u, unknownMaterializationReceipt as ui, isTerminalDecision as un, toOtelAttributes as ur, createInPlaceCliExecutor as ut, createScope as v, canonicalStreamEventFromSandboxEvent as vi, runBrainLoop as vn, captureWorktreeDiff as vr, pendingWaits as vt, scopeOwnerExecutorNodeContext as w, mapSandboxToolEvent as wi, providerAsSandboxClient as wn, localHarnessExecutable as wr, workerTraceAnalysisStore as wt, meterRuntimeOwnedProviderAttempt as x, extractLlmCallEvent as xi, DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS as xn, DEFAULT_LOCAL_HARNESS as xr, captureWorkerTraceEvidence as xt, deriveNodeExecutionIdentity as y, createSandboxToolPartState as yi, canonicalObservedModelParts as yn, createWorktree as yr, replaySpawnTree as yt, readWorkerInteractiveAdmissions as z, throwAbort as zi, startRetainedRunInEnvironment as zn, sandboxActProfileMaterialization as zr, createActivityLog as zt };
|
|
24570
24664
|
|
|
24571
|
-
//# sourceMappingURL=supervisor-
|
|
24665
|
+
//# sourceMappingURL=supervisor-BN3oMv_v.js.map
|