@tangle-network/agent-runtime 0.332.2 → 0.333.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.
Files changed (50) hide show
  1. package/dist/{activation-DkKF3lyi.d.ts → activation-BGZ0rVuv.d.ts} +2 -2
  2. package/dist/{activation-DTOKMsMY.js → activation-Vw-UZJv6.js} +2 -2
  3. package/dist/{activation-DTOKMsMY.js.map → activation-Vw-UZJv6.js.map} +1 -1
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-driver-IIQqx1_9.js → coordination-driver-B6gob9rN.js} +2 -2
  7. package/dist/{coordination-driver-IIQqx1_9.js.map → coordination-driver-B6gob9rN.js.map} +1 -1
  8. package/dist/{delegate-CPRltuG7.js → delegate-C8yWI1p2.js} +2 -2
  9. package/dist/{delegate-CPRltuG7.js.map → delegate-C8yWI1p2.js.map} +1 -1
  10. package/dist/durable.d.ts +1 -1
  11. package/dist/durable.js +3 -3
  12. package/dist/{graph-DJUK6gQG.js → graph-SJbUv3UT.js} +4 -4
  13. package/dist/{graph-DJUK6gQG.js.map → graph-SJbUv3UT.js.map} +1 -1
  14. package/dist/{improvement-cycle-DZVxkWFq.js → improvement-cycle-6n7s5xCm.js} +3 -3
  15. package/dist/{improvement-cycle-DZVxkWFq.js.map → improvement-cycle-6n7s5xCm.js.map} +1 -1
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +7 -7
  18. package/dist/intelligence.d.ts +2 -2
  19. package/dist/intelligence.js +3 -3
  20. package/dist/kernel.d.ts +1 -1
  21. package/dist/kernel.js +8 -8
  22. package/dist/{loop-runner-bin-DMrnuxYq.js → loop-runner-bin-3OdukLK8.js} +3 -3
  23. package/dist/{loop-runner-bin-DMrnuxYq.js.map → loop-runner-bin-3OdukLK8.js.map} +1 -1
  24. package/dist/{loop-runner-bin-CoRzW_T9.d.ts → loop-runner-bin-CaH_49Ts.d.ts} +2 -2
  25. package/dist/loop-runner-bin.d.ts +1 -1
  26. package/dist/loop-runner-bin.js +1 -1
  27. package/dist/mcp/bin.js +3 -3
  28. package/dist/mcp/index.d.ts +2 -2
  29. package/dist/mcp/index.js +4 -4
  30. package/dist/{openai-tools-CtBa9-9s.d.ts → openai-tools-BhO6-5ff.d.ts} +2 -2
  31. package/dist/profiles.d.ts +1 -1
  32. package/dist/{provision-supervisor-CslUvoK2.js → provision-supervisor-DUtSy0yS.js} +3 -3
  33. package/dist/{provision-supervisor-CslUvoK2.js.map → provision-supervisor-DUtSy0yS.js.map} +1 -1
  34. package/dist/{runtime-Dd8SO8Ux.js → runtime-PcxLUbUI.js} +8 -8
  35. package/dist/{runtime-Dd8SO8Ux.js.map → runtime-PcxLUbUI.js.map} +1 -1
  36. package/dist/{search-executor-0pg677OV.js → search-executor-THPHYkHm.js} +2 -2
  37. package/dist/{search-executor-0pg677OV.js.map → search-executor-THPHYkHm.js.map} +1 -1
  38. package/dist/{server-CFS9dxVk.js → server-C-bJwSlH.js} +3 -3
  39. package/dist/{server-CFS9dxVk.js.map → server-C-bJwSlH.js.map} +1 -1
  40. package/dist/{supervise-Be6b-t1q.js → supervise-CrZSI8RM.js} +3 -3
  41. package/dist/{supervise-Be6b-t1q.js.map → supervise-CrZSI8RM.js.map} +1 -1
  42. package/dist/{supervisor-BdErSfQ0.js → supervisor-BfIZXA7e.js} +52 -6
  43. package/dist/supervisor-BfIZXA7e.js.map +1 -0
  44. package/dist/testing.d.ts +1 -1
  45. package/dist/testing.js +12 -12
  46. package/dist/tui/index.d.ts +1 -1
  47. package/dist/tui/index.js +1 -1
  48. package/dist/{types-CKPP2wxk.d.ts → types-CsDKtdE3.d.ts} +6 -5
  49. package/package.json +1 -1
  50. package/dist/supervisor-BdErSfQ0.js.map +0 -1
@@ -18102,7 +18102,8 @@ function bridgeGet(seam, path, timeoutMs, signal) {
18102
18102
  */
18103
18103
  async function bridgeModelRouteRefusal(seam, wireModel, signal) {
18104
18104
  const base = seam.bridgeUrl.replace(/\/$/, "");
18105
- if (routedModels.get(base)?.has(wireModel)) return void 0;
18105
+ const known = routedModels.get(base)?.get(wireModel);
18106
+ if (known !== void 0) return silenceBoundRefusal(seam, base, wireModel, known);
18106
18107
  let answer;
18107
18108
  try {
18108
18109
  answer = await bridgeGet(seam, `/v1/capabilities?model=${encodeURIComponent(wireModel)}`, BRIDGE_ROUTE_PROBE_TIMEOUT_MS, signal);
@@ -18114,13 +18115,18 @@ async function bridgeModelRouteRefusal(seam, wireModel, signal) {
18114
18115
  };
18115
18116
  }
18116
18117
  if (answer.status === 200) {
18118
+ let toolCallSpans = false;
18119
+ try {
18120
+ toolCallSpans = JSON.parse(answer.body).toolCallSpans === true;
18121
+ } catch {}
18117
18122
  let routed = routedModels.get(base);
18118
18123
  if (routed === void 0) {
18119
- routed = /* @__PURE__ */ new Set();
18124
+ routed = /* @__PURE__ */ new Map();
18120
18125
  routedModels.set(base, routed);
18121
18126
  }
18122
- routed.add(wireModel);
18123
- return;
18127
+ const route = { toolCallSpans };
18128
+ routed.set(wireModel, route);
18129
+ return silenceBoundRefusal(seam, base, wireModel, route);
18124
18130
  }
18125
18131
  if (answer.status === 404) return {
18126
18132
  detail: `bridge ${base} routes no backend for model ${JSON.stringify(wireModel)}`,
@@ -18134,6 +18140,20 @@ async function bridgeModelRouteRefusal(seam, wireModel, signal) {
18134
18140
  };
18135
18141
  }
18136
18142
  /**
18143
+ * `modelSilenceMs` reads a running tool as model silence on a backend whose stream does not report
18144
+ * a tool call at its start and its end. cli-bridge's opencode backend reports a call only once it
18145
+ * has finished: magnetar-rust-20261018b's 32-minute prove battery left no event for 32.4 minutes,
18146
+ * which a 15-minute bound would have cut. So the bound runs only where the route declares
18147
+ * `toolCallSpans: true`, and a bridge that declares nothing is refused.
18148
+ */
18149
+ function silenceBoundRefusal(seam, base, wireModel, route) {
18150
+ if (seam.modelSilenceMs === void 0 || route.toolCallSpans) return void 0;
18151
+ return {
18152
+ detail: `bridge ${base} serves model ${JSON.stringify(wireModel)} on a backend that does not declare toolCallSpans, so modelSilenceMs cannot tell a running tool from a silent model; remove modelSilenceMs for this backend`,
18153
+ retryable: false
18154
+ };
18155
+ }
18156
+ /**
18137
18157
  * Read the default bulk lane from `GET /health`. Runtime sends no reserved-client header, so
18138
18158
  * overall capacity can look free while the lane this request will use is already full. Older
18139
18159
  * bridges expose only the overall counters; those retain the prior fallback.
@@ -19359,6 +19379,19 @@ const DEFAULT_MAX_ATTEMPTS = Number.POSITIVE_INFINITY;
19359
19379
  const DEFAULT_INITIAL_BACKOFF_MS = 2e3;
19360
19380
  const DEFAULT_MAX_BACKOFF_MS = 3e4;
19361
19381
  const DEFAULT_TRANSIENT_OUTAGE_MS = 9e5;
19382
+ /**
19383
+ * The repeated-failure bound: attempts that each fail within {@link INSTANT_FAILURE_MS} with the
19384
+ * same error, {@link REPEATED_FAILURE_LIMIT} or more in a row over at least
19385
+ * {@link REPEATED_FAILURE_WINDOW_MS}, stop the run with `repeated-failure` whatever the rest of the
19386
+ * run is doing. The progress mark is run-wide, so while other nodes spend or settle, a driver that
19387
+ * dies on arrival reads as progressing and the barren bound never fires: on Discovery run
19388
+ * magnetar-rust-20261017c, 1,258 of 2,069 root attempts failed with 'connect ECONNREFUSED
19389
+ * 127.0.0.1:32897' between 13:20Z and 16:05Z. The window keeps a local server's restart, which
19390
+ * takes seconds, from ending a run.
19391
+ */
19392
+ const INSTANT_FAILURE_MS = 3e4;
19393
+ const REPEATED_FAILURE_LIMIT = 10;
19394
+ const REPEATED_FAILURE_WINDOW_MS = 5 * 6e4;
19362
19395
  /** Consecutive identical reconciliation failures of one pending invocation that resolve it. */
19363
19396
  const SAME_PENDING_LIMIT = 2;
19364
19397
  /**
@@ -19678,6 +19711,7 @@ async function runDriverWithRetry(run) {
19678
19711
  let outageSince;
19679
19712
  let consecutivePauses = 0;
19680
19713
  let samePending;
19714
+ let sameFailure;
19681
19715
  let abandonments = 0;
19682
19716
  let pauses = 0;
19683
19717
  let continuations = 0;
@@ -19801,6 +19835,17 @@ async function runDriverWithRetry(run) {
19801
19835
  else outageSince ??= failedAt;
19802
19836
  const inOutage = idle && failedAt - (outageSince ?? failedAt) < transientOutage;
19803
19837
  if (!inOutage) chargedFailures += 1;
19838
+ const failure = errMessage(error);
19839
+ sameFailure = durationMs >= INSTANT_FAILURE_MS ? void 0 : sameFailure?.error === failure ? {
19840
+ error: failure,
19841
+ count: sameFailure.count + 1,
19842
+ since: sameFailure.since
19843
+ } : {
19844
+ error: failure,
19845
+ count: 1,
19846
+ since: failedAt
19847
+ };
19848
+ const repeated = sameFailure !== void 0 && sameFailure.count >= REPEATED_FAILURE_LIMIT && failedAt - sameFailure.since >= REPEATED_FAILURE_WINDOW_MS;
19804
19849
  const stop = (() => {
19805
19850
  if (classification === "terminal") return "terminal-error";
19806
19851
  if (!retryEnabled) return "retry-disabled";
@@ -19809,7 +19854,7 @@ async function runDriverWithRetry(run) {
19809
19854
  if (byBudget) return byBudget;
19810
19855
  if (inOutage) return void 0;
19811
19856
  if (chargedFailures >= maxAttempts) return "max-attempts";
19812
- if (progressed) return void 0;
19857
+ if (progressed) return repeated ? "repeated-failure" : void 0;
19813
19858
  return consecutiveBarren + 1 >= maxConsecutive ? "no-progress" : void 0;
19814
19859
  })();
19815
19860
  let abandoned = false;
@@ -19863,6 +19908,7 @@ async function runDriverWithRetry(run) {
19863
19908
  consecutivePauses = 0;
19864
19909
  outageSince = void 0;
19865
19910
  samePending = void 0;
19911
+ sameFailure = void 0;
19866
19912
  abandonments = 0;
19867
19913
  const durationMs = now() - startedAt;
19868
19914
  const after = run.progress();
@@ -31978,4 +32024,4 @@ function isNonEmptySpend(s) {
31978
32024
  //#endregion
31979
32025
  export { readWorkerInteractiveBinding as $, FileSpawnJournal as $i, persistHarnessTranscript as $n, renderProfileMaterializationIssues as $r, admitContinuationPolicy as $t, bindScopeRetainedOwnerProvider as A, awaitAbortable$1 as Ai, providerAsExecutor as An, runWorktreeHarness as Ar, AUTHORITY_MARKERS as At, scopeRetainedOwnerRestorePoint as B, canonicalStreamEventFromSandboxEvent as Bi, startRetainedRun as Bn, CodexExecutionDiagnosticError as Br, DriverAttemptsExhaustedError as Bt, recordScopeOwnerPause as C, spendFromUsageTotals as Ca, unknownExecutionBindingReceipt as Ci, captureBeforeDestroy as Cn, toOtelAttributes as Cr, workerTraceHeaders as Ct, abandonScopeRetainedOwnerInvocation as D, promptFromAgentTurnInput as Da, projectSandboxOutcome as Di, runBrainLoop as Dn, sanitizeKnowledgeReadinessReport as Dr, createActivityLog as Dt, settledToIteration as E, resolveRedactor as Ea, executableAgentSpecSnapshot as Ei, routerBrain as En, sanitizeAgentRuntimeEvent as Er, DEFAULT_STALL_AFTER_MS as Et, reconcileScopeRetainedOwnerEnvironment as F, unavailablePauseMs as Fi, sandboxSessionTraceSource as Fn, LOCAL_HARNESSES as Fr, isPeerMailEnvelope as Ft, hostDirectoryReader as G, mapSandboxEvent as Gi, createWorkerSlots as Gn, controlProfileMaterialization as Gr, upstreamUnavailableSignal as Gt, scopeRetainedOwnerTurnEnded as H, createSandboxUsageLedger as Hi, retainedCreateMaterial as Hn, AGENT_PROFILE_MATERIALIZATION_AXES as Hr, classifyDriverFailure as Ht, scopeRetainedOwnerContext as I, unavailableSignalOfFailure as Ii, bridgeRuntimeAttachmentsKey as In, harnessInvocation as Ir, peerMailTools as It, coordinationProfileToolPrefix as J, sandboxEventServedBackend as Ji, abortError as Jn, profileMaterializationAxes$1 as Jr, authoredSeatStages as Jt, resolveSpawnResourcePaths as K, mapSandboxToolEvent as Ki, openSlotGroup as Kn, defineProfileMaterializationContract as Kr, SeatChain as Kt, scopeRetainedOwnerJournalRoot as L, TRACE_ROOT_SCHEMA as Li, bridgeStopSignalKey as Ln, harnessSupportsReasoningEffort as Lr, peerMailVerbNames as Lt, noteScopeRetainedOwnerCoordination as M, settlementFailureCause as Mi, resolveAgentEnvironmentProvider as Mn, createWorktree as Mr, PEER_MAIL_WIRE_KEY as Mt, prepareScopeRetainedOwnerSeatSwitch as N, registerRetainedExecutorPreparation as Ni, createPushTraceSource as Nn, removeWorktree as Nr, claimsAuthority as Nt, beginScopeRetainedOwnerDrive as O, promptOptionsFromAgentTurnInput as Oa, readSandboxOutcome as Oi, LEAF_CONTINUATION_TASK as On, sanitizeRuntimeStreamEvent as Or, readWorkerProgress as Ot, prepareScopeRetainedOwnerTask as P, retainedExecutorSeamKey as Pi, decodeToolPart as Pn, DEFAULT_LOCAL_HARNESS as Pr, createPeerMailbox as Pt, attachWorker as Q, FileResultBlobStore as Qi, harnessTranscriptArtifact as Qn, promptResourceProfileMaterialization as Qr, CheckUnavailableError as Qt, scopeRetainedOwnerPriorSpend as R, TRACE_SUMMARY_SCHEMA as Ri, reconnectRetainedRun as Rn, localHarnessExecutable as Rr, isLiveNodeStatus as Rt, recordScopeOwnerMaterialization as S, spendFromUsageEvents as Sa, runtimeOwnedScopeOwnerRuntime as Si, SandboxEvidenceRetentionError as Sn, padTraceId as Sr, workerTraceEnv as St, scopeOwnerExecutorNodeContext as T, defaultRedactorIdentityMaterial as Ta, executableAgentProfileSnapshot as Ti, readPromptOptions as Tn, createRuntimeStreamEventCollector as Tr, taskToPrompt as Tt, SPAWN_RESOURCE_PATH_MAX_BYTES as U, extractLlmCallEvent as Ui, destroyInteractiveEnvironment as Un, assertProfileMaterialization as Ur, runDriverWithRetry as Ut, scopeRetainedOwnerResult as V, createSandboxToolPartState as Vi, startRetainedRunInEnvironment as Vn, terminateProcessTreeAndConfirm as Vr, HarnessTurnFailedError as Vt, environmentReader as W, isSandboxTerminalEvent as Wi, environmentGone as Wn, assertProfileMaterializes as Wr, summarizeDriverAttempts as Wt, runtimeGraphMetadataKey as X, sumSandboxUsage as Xi, runAbortable as Xn, promptModelProfileMaterialization as Xr, CONTINUATIONS_DIR as Xt, providerVisibleProfile as Y, sandboxProgressEvents as Yi, linkAbort as Yn, promptControlProfileMaterialization as Yr, seatExecutionProfile as Yt, interactiveAdmissionSeamKey as Z, decodeHarnessUsage as Zi, captureHarnessTranscript as Zn, promptOnlyProfileMaterialization as Zr, CONTINUATION_FACTS as Zt, deriveNodeExecutionIdentity as _, ReservationWaitRefused as _a, runtimeOwnedDriveHarnessProviderEvidence as _i, defaultSelectWinner as _n, createOtelExporter as _r, createSteerableSandboxSession as _t, collectDelivered as a, replaySpawnTree as aa, worktreeCliProfileMaterialization as ai, expandQuestions as an, runCodeMode as ar, rollingDispatch as at, noteScopeOwnerPlannedExecution as b, meterUsageEvent as ba, runtimeOwnedExecutorProviderEvidence as bi, createSandboxLineage as bn, loopEventToOtelSpan as br, WORKER_TRACE_PROPAGATION as bt, runTree as c, isTraceAnalysisStore as ca, authoredAgentIdentity as ci, verdictFromJudgeScore as cn, ROUTER_PRICE_SOURCE as cr, bindReusableExecutorExecutionId as ct, isDriverSpec as d, contentAddress as da, inheritRuntimeOwnedExecutorAttestation as di, addHarnessUsage as dn, readTraceContextFromEnv as dr, cliWorktreeExecutor as dt, InMemoryResultBlobStore as ea, renderUnsupported as ei, admitFinding as en, readHarnessTranscript as er, reconnectRetainedInteractiveRun as et, withDriverExecutor as f, detachedFrozen as fa, knownExecutionBindingReceipt as fi, createCodexRolloutStoreReader as fn, traceContextToEnv as fr, createExecutor as ft, createScope as g, BudgetReconcileFault as ga, recordRuntimeOwnedDriveHarnessProviderEvidence as gi, createSandboxForSpec as gn, createOpenInferenceFileExporter as gr, DEFAULT_SANDBOX_STEERING_MAX_TURNS as gt, beginScopeOwnerAttempt as h, errMessage as ha, providerAttemptEvidence as hi, TERMINAL_DECISIONS as hn, buildRuntimeEventOtelSpans as hr, createWorktreeCliExecutor as ht, bestDelivered as i, materializeTreeView as ia, validateProfileMaterialization as ii, distillFindings as in, describeCodeModeTools as ir, queueOf as it, consumeScopeRetainedOwnerResult as j, runtimeFailureCause as ji, providerAsSandboxClient as jn, captureWorktreeDiff as jr, DEFAULT_PEER_MAIL_LIMITS as jt, bindScopeRetainedOwnerEnvironmentId as k, providerMessageText as ka, abortError$1 as ki, createAgentEnvironmentProviderRegistry as kn, runSettledCommand as kr, createInbox as kt, driverChild as l, parseWorkerToolTraceArtifact as la, authoredProfileDigest as li, bridgeAdmissionRefusal as ln, createPropagatingTraceEmitter as lr, captureReusableExecutorConfig as lt, assertRecursiveReservationPolicy as m, executorFailure as ma, newExecutionAttemptId as mi, readCodexRolloutSession as mn, buildLoopSpanNodes as mr, snapshotExecutorConfig as mt, createRootHandle as n, insideCursorNamespace as na, sandboxProfileMaterialization as ni, checkVerdictOf as nn, retainHarnessTranscript as nr, startRetainedInteractiveRun as nt, pickBestDelivered as o, WORKER_TOOL_TRACE_SCHEMA_VERSION as oa, attestRuntimeOwnedPendingExecutor as oi, failedItems as on, priceTokens as or, gateOnDeliverable as ot, SUBTREE_RESULT_LIMIT as p, detachedSnapshot as pa, knownMaterializationReceipt as pi, harnessUsageIsEmpty as pn, buildLoopOtelSpans as pr, createExecutorRegistry as pt, coordinationMcpAlias as q, notifySandboxEventObserver as qi, RunCancellationReason as qn, fullProfileMaterialization as qr, SeatChainExhaustedError as qt, createSupervisor as r, loadSpawnForest as ra, unsupportedProfileDimensions as ri, createContinuationKeeper as rn, createCodeModeTools as rr, freeSlots as rt, runFinalizer as s, captureWorkerTraceEvidence as sa, attestRuntimeOwnedScopeOwner as si, passedItems as sn, routerTokenPrice as sr, mapExecutorResult as st, DEFAULT_MAX_DEPTH as t, InMemorySpawnJournal as ta, sandboxActProfileMaterialization as ti, bestComposite as tn, resolveHarnessTranscriptCapture as tr, recoverRetainedInteractiveRun as tt, driverExecutorFactory as u, workerTraceAnalysisStore as ua, finalizeRuntimeOwnedPendingExecutor as ui, bridgeModelRouteRefusal as un, mergeTraceEnv as ur, cliInPlaceExecutor as ut, meterRuntimeOwnedAccounting as v, assertValidBudget as va, runtimeOwnedExecutorExecutionBinding as vi, isTerminalDecision as vn, flatOtelSpan as vr, createRouterTranscript as vt, restoreScopeOwnerAcceptedExecution as w, defaultRedactor as wa, unknownMaterializationReceipt as wi, assertBoxlessPromptOptions as wn, createRuntimeEventCollector as wr, workerTraceSeamKey as wt, recordScopeOwnerDriverAttempt as x, newUsageTotals as xa, runtimeOwnedPendingExecutorMaterialization as xi, acquireSandbox as xn, padSpanId as xr, readWorkerTraceContext as xt, meterRuntimeOwnedProviderAttempt as y, createBudgetPool as ya, runtimeOwnedExecutorMaterialization as yi, runAgentRounds as yn, generateSpanId as yr, createInPlaceCliExecutor as yt, scopeRetainedOwnerResourceReader as z, assertSandboxServedModel as zi, recoverRetainedRun as zn, parseCodexTokenUsage as zr, isTerminalNodeStatus as zt };
31980
32026
 
31981
- //# sourceMappingURL=supervisor-BdErSfQ0.js.map
32027
+ //# sourceMappingURL=supervisor-BfIZXA7e.js.map