omnius 1.0.843 → 1.0.845

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/index.js
3
- size: 37064391 bytes
4
- sha256: 1c020e46538ba5a79d1d2b7586f2f8922b0f4bab36354bd878b49939461d8d9b
3
+ size: 37075222 bytes
4
+ sha256: a9cbdc655c3f3be3c254f09caaa9149c8677cb9858cb12940142e24dc9eb514e
package/dist/library.js CHANGED
@@ -349062,7 +349062,23 @@ function routeKey(route) {
349062
349062
  return `${new URL(route.baseUrl).origin}\0${route.model}`;
349063
349063
  }
349064
349064
  function errorStatus(error) {
349065
- return object4(error) && typeof error.status === "number" ? error.status : void 0;
349065
+ for (const value of errorChain(error)) {
349066
+ if (object4(value) && typeof value.status === "number" && Number.isInteger(value.status) && value.status >= 100 && value.status <= 599)
349067
+ return value.status;
349068
+ }
349069
+ return void 0;
349070
+ }
349071
+ function errorChain(error) {
349072
+ const chain = [];
349073
+ for (let current = error; current && chain.length < 8 && !chain.includes(current); current = object4(current) ? current.cause : void 0)
349074
+ chain.push(current);
349075
+ return chain;
349076
+ }
349077
+ function safeFailure(error) {
349078
+ const status = errorStatus(error);
349079
+ const chain = errorChain(error);
349080
+ const category = status === 429 ? "rate_limit" : status === 401 || status === 403 ? "authentication" : status !== void 0 && status >= 400 && status < 500 ? "request_rejected" : status !== void 0 && status >= 500 ? "upstream_unavailable" : chain.some((value) => value instanceof AttemptTimeout || object4(value) && (value.name === "TimeoutError" || value.name === "AbortError" || value.code === "ETIMEDOUT")) ? "timeout" : chain.some((value) => value instanceof EmptyInferenceResponse) ? "empty_response" : chain.some((value) => value instanceof SyntaxError) ? "invalid_response" : "transport";
349081
+ return { category, ...status === void 0 ? {} : { status } };
349066
349082
  }
349067
349083
  function transportFailure(error) {
349068
349084
  if (parseProviderContextOverflow(error))
@@ -349159,9 +349175,12 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349159
349175
  if (!this.eligible(request))
349160
349176
  return local(request);
349161
349177
  this.fence(request);
349178
+ let localSelected = false;
349162
349179
  try {
349163
349180
  if (this.localAdmissionTimeoutMs(request) === 0)
349164
349181
  throw new AttemptTimeout();
349182
+ this.lifecycle(request, "selected");
349183
+ localSelected = true;
349165
349184
  const result = await this.attempt(request, this.policy.localTimeoutMs, async (bounded3) => {
349166
349185
  if (bounded3.localAdmissionFailure !== void 0)
349167
349186
  throw bounded3.localAdmissionFailure;
@@ -349170,16 +349189,19 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349170
349189
  if (!usableResult(result))
349171
349190
  throw new EmptyInferenceResponse();
349172
349191
  localCooldowns.delete(routeKey(this.primary));
349192
+ this.lifecycle(request, "succeeded");
349173
349193
  return result;
349174
349194
  } catch (error) {
349175
349195
  this.fence(request);
349196
+ if (localSelected)
349197
+ this.lifecycle(request, "failed", void 0, error);
349176
349198
  if (!transportFailure(error))
349177
349199
  throw error;
349178
349200
  this.localCooldown();
349179
349201
  }
349180
349202
  await this.approveRemoteFallback(request);
349181
349203
  const deadline = this.now() + this.policy.totalTimeoutMs;
349182
- for await (const candidate of this.candidates(request, deadline)) {
349204
+ for await (const candidate of this.retryableCandidates(request, deadline)) {
349183
349205
  if (this.now() >= deadline)
349184
349206
  break;
349185
349207
  try {
@@ -349193,9 +349215,11 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349193
349215
  if (!usableResult(result))
349194
349216
  throw new EmptyInferenceResponse();
349195
349217
  cooldowns.delete(routeKey(candidate));
349218
+ this.lifecycle(request, "succeeded", candidate);
349196
349219
  return this.scrubber(candidate)(result);
349197
349220
  } catch (error) {
349198
349221
  this.fence(request);
349222
+ this.lifecycle(request, "failed", candidate, error);
349199
349223
  this.cooldown(candidate, error);
349200
349224
  }
349201
349225
  }
@@ -349219,9 +349243,12 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349219
349243
  }
349220
349244
  this.fence(request);
349221
349245
  let emitted = false;
349246
+ let localSelected = false;
349222
349247
  try {
349223
349248
  if (this.localAdmissionTimeoutMs(request) === 0)
349224
349249
  throw new AttemptTimeout();
349250
+ this.lifecycle(request, "selected");
349251
+ localSelected = true;
349225
349252
  if (request.localAdmissionFailure !== void 0)
349226
349253
  throw request.localAdmissionFailure;
349227
349254
  for await (const chunk of this.requireUsableStream(this.boundedStream(request, this.policy.localTimeoutMs, local, true))) {
@@ -349229,9 +349256,12 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349229
349256
  yield chunk;
349230
349257
  }
349231
349258
  localCooldowns.delete(routeKey(this.primary));
349259
+ this.lifecycle(request, "succeeded");
349232
349260
  return;
349233
349261
  } catch (error) {
349234
349262
  this.fence(request);
349263
+ if (localSelected)
349264
+ this.lifecycle(request, "failed", void 0, error);
349235
349265
  if (emitted)
349236
349266
  throw new StreamInterruptedError();
349237
349267
  if (!transportFailure(error))
@@ -349240,7 +349270,7 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349240
349270
  }
349241
349271
  await this.approveRemoteFallback(request);
349242
349272
  const deadline = this.now() + this.policy.totalTimeoutMs;
349243
- for await (const candidate of this.candidates(request, deadline)) {
349273
+ for await (const candidate of this.retryableCandidates(request, deadline)) {
349244
349274
  if (this.now() >= deadline)
349245
349275
  break;
349246
349276
  try {
@@ -349264,9 +349294,11 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349264
349294
  yield chunk;
349265
349295
  }
349266
349296
  cooldowns.delete(routeKey(candidate));
349297
+ this.lifecycle(request, "succeeded", candidate);
349267
349298
  return;
349268
349299
  } catch (error) {
349269
349300
  this.fence(request);
349301
+ this.lifecycle(request, "failed", candidate, error);
349270
349302
  if (emitted)
349271
349303
  throw new StreamInterruptedError();
349272
349304
  this.cooldown(candidate, error);
@@ -349401,6 +349433,26 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349401
349433
  });
349402
349434
  request.onInferenceRoute?.({ ...this.lastRoute });
349403
349435
  this.options.onRoute?.({ providerId: this.lastRoute.providerId, model: this.lastRoute.model });
349436
+ this.lifecycle(request, "selected", route);
349437
+ }
349438
+ lifecycle(request, phase, route, error) {
349439
+ this.fence(request);
349440
+ if (!request.onInferenceRouteLifecycle)
349441
+ return;
349442
+ const receipt = {
349443
+ location: route ? "remote" : "local",
349444
+ phase,
349445
+ model: route?.model ?? this.primary.model,
349446
+ providerId: route ? route.keyless?.id ?? route.providerId ?? "remote" : this.primary.providerId ?? "ollama",
349447
+ backendType: route ? "vllm" : this.primary.backendType ?? "ollama",
349448
+ ...request.logicalRequestId ? { logicalRequestId: request.logicalRequestId } : {},
349449
+ ...phase === "failed" ? { failure: safeFailure(error) } : {}
349450
+ };
349451
+ try {
349452
+ request.onInferenceRouteLifecycle(this.scrubber(route)(receipt));
349453
+ } catch {
349454
+ this.fence(request);
349455
+ }
349404
349456
  }
349405
349457
  async prepare(route) {
349406
349458
  await this.validate(route.baseUrl);
@@ -349476,14 +349528,14 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349476
349528
  configuredEndpointOnly: true,
349477
349529
  disableEmptyContentRecovery: true,
349478
349530
  maxTokens: this.remoteOutputTokens(request, route),
349479
- ...route.contextWindow || route.maxOutputTokens ? { providerDefaultOutput: void 0 } : {},
349531
+ ...route.contextWindow || route.maxOutputTokens ? { providerDefaultOutput: void 0 } : route.keyless ? { providerDefaultOutput: true, remoteProviderDefaultOutput: true } : {},
349480
349532
  preferNativeOllamaChat: false,
349481
349533
  think: false,
349482
349534
  ...route.keyless?.directAnswer ? { chatTemplateKwargs: { enable_thinking: false } } : {},
349483
349535
  timeoutMs: Math.min(request.timeoutMs, this.policy.requestTimeoutMs)
349484
349536
  };
349485
349537
  }
349486
- compatible(request, route) {
349538
+ compatible(request, route, includeCooling = false) {
349487
349539
  if (this.scrubber(route)(route.model) !== route.model)
349488
349540
  return false;
349489
349541
  if (request.tools.length && !route.nativeToolsHint || hasImages(request) && !route.images)
@@ -349499,7 +349551,7 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349499
349551
  const minimum = route.contextWindow ? Math.min(request.maxTokens, minimumOutputTokens(route.contextWindow)) : 1;
349500
349552
  if (this.remoteOutputTokens(request, route) < minimum)
349501
349553
  return false;
349502
- return (cooldowns.get(routeKey(route)) ?? 0) <= this.now();
349554
+ return includeCooling || (cooldowns.get(routeKey(route))?.until ?? 0) <= this.now();
349503
349555
  }
349504
349556
  remoteOutputTokens(request, route) {
349505
349557
  let budget = Math.min(request.maxTokens, route.maxOutputTokens ?? Infinity);
@@ -349514,12 +349566,66 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349514
349566
  return Math.floor(budget);
349515
349567
  }
349516
349568
  cooldown(route, error) {
349517
- const hinted = object4(error) && typeof error.retryAfterMs === "number" && Number.isFinite(error.retryAfterMs) ? Math.max(0, Math.min(3e5, error.retryAfterMs)) : 0;
349569
+ const status = errorStatus(error);
349570
+ route.lastAttemptRateLimited = status === 429;
349571
+ if (status !== void 0 && status >= 400 && status < 500 && status !== 429)
349572
+ return;
349573
+ const hint = errorChain(error).find((value) => object4(value) && typeof value.retryAfterMs === "number" && Number.isFinite(value.retryAfterMs));
349574
+ const hinted = object4(hint) && typeof hint.retryAfterMs === "number" ? Math.max(1, Math.min(3e5, hint.retryAfterMs)) : void 0;
349518
349575
  if (cooldowns.size >= 256)
349519
349576
  cooldowns.delete(cooldowns.keys().next().value);
349520
- cooldowns.set(routeKey(route), this.now() + Math.max(15e3, hinted));
349577
+ cooldowns.set(routeKey(route), {
349578
+ until: this.now() + (status === 429 ? hinted ?? 15e3 : Math.max(15e3, hinted ?? 0)),
349579
+ rateLimited: status === 429
349580
+ });
349581
+ }
349582
+ async *retryableCandidates(request, deadline) {
349583
+ const waiting = /* @__PURE__ */ new Map();
349584
+ const attempts = /* @__PURE__ */ new Map();
349585
+ const defer = (candidate) => {
349586
+ const key = routeKey(candidate);
349587
+ if (candidate.lastAttemptRateLimited && (attempts.get(key) ?? 0) < 3)
349588
+ waiting.set(key, candidate);
349589
+ };
349590
+ for await (const candidate of this.candidates(request, deadline, true)) {
349591
+ const key = routeKey(candidate);
349592
+ if ((cooldowns.get(key)?.until ?? 0) > this.now()) {
349593
+ if (cooldowns.get(key)?.rateLimited)
349594
+ waiting.set(key, candidate);
349595
+ continue;
349596
+ }
349597
+ if (this.now() >= deadline)
349598
+ return;
349599
+ attempts.set(key, 1);
349600
+ yield candidate;
349601
+ defer(candidate);
349602
+ }
349603
+ while (waiting.size && this.now() < deadline) {
349604
+ this.fence(request);
349605
+ const [key, candidate] = [...waiting].sort(([a], [b]) => (cooldowns.get(a)?.until ?? 0) - (cooldowns.get(b)?.until ?? 0))[0];
349606
+ const delay2 = Math.max(0, (cooldowns.get(key)?.until ?? 0) - this.now());
349607
+ if (delay2 >= deadline - this.now())
349608
+ return;
349609
+ if (delay2) {
349610
+ let timer;
349611
+ try {
349612
+ const pause = new Promise((resolve38) => {
349613
+ timer = setTimeout(resolve38, delay2);
349614
+ });
349615
+ await (request.signal ? this.abortable(pause, request.signal) : pause);
349616
+ } finally {
349617
+ clearTimeout(timer);
349618
+ }
349619
+ this.fence(request);
349620
+ continue;
349621
+ }
349622
+ waiting.delete(key);
349623
+ attempts.set(key, (attempts.get(key) ?? 0) + 1);
349624
+ yield candidate;
349625
+ defer(candidate);
349626
+ }
349521
349627
  }
349522
- async *candidates(request, deadline) {
349628
+ async *candidates(request, deadline, includeCooling = false) {
349523
349629
  let count2 = 0;
349524
349630
  const seen = /* @__PURE__ */ new Set();
349525
349631
  for (const profile3 of this.policy.providers) {
@@ -349538,7 +349644,7 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349538
349644
  profile: profile3
349539
349645
  };
349540
349646
  const key = routeKey(route);
349541
- if (!seen.has(key) && this.compatible(request, route)) {
349647
+ if (!seen.has(key) && this.compatible(request, route, includeCooling)) {
349542
349648
  seen.add(key);
349543
349649
  yield route;
349544
349650
  if (++count2 >= MAX_ROUTES2 || this.now() >= deadline)
@@ -349578,7 +349684,7 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349578
349684
  keyless: provider,
349579
349685
  ...provider.anonymousAuthorization === "Bearer unused" ? { apiKey: "unused" } : {}
349580
349686
  };
349581
- if (seen.has(routeKey(route)) || !this.compatible(request, route))
349687
+ if (seen.has(routeKey(route)) || !this.compatible(request, route, includeCooling))
349582
349688
  continue;
349583
349689
  seen.add(routeKey(route));
349584
349690
  try {
@@ -349609,7 +349715,7 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349609
349715
  if (Array.isArray(selected.supported_parameters) && request.tools.length && !selected.supported_parameters.includes("tools"))
349610
349716
  continue;
349611
349717
  }
349612
- if (!route.model || !this.compatible(request, route))
349718
+ if (!route.model || !this.compatible(request, route, includeCooling))
349613
349719
  continue;
349614
349720
  const actualKey = routeKey(route);
349615
349721
  if (actualKey !== `${new URL(route.baseUrl).origin}\0${provider.model}` && seen.has(actualKey))
@@ -388269,7 +388375,7 @@ ${read.content}`;
388269
388375
  throw new Error("interruption_stale_model_dispatch");
388270
388376
  };
388271
388377
  assertCurrent();
388272
- const needsRouteHooks = typeof backend.canUseRemoteFallback === "function" || typeof this.backend.canUseRemoteFallback === "function" || outbound.assertCurrentAtDispatch !== void 0 || outbound.onInferenceRoute !== void 0;
388378
+ const needsRouteHooks = typeof backend.canUseRemoteFallback === "function" || typeof this.backend.canUseRemoteFallback === "function" || outbound.assertCurrentAtDispatch !== void 0 || outbound.onInferenceRoute !== void 0 || outbound.onInferenceRouteLifecycle !== void 0;
388273
388379
  const dispatchRequest = needsRouteHooks ? {
388274
388380
  ...outbound,
388275
388381
  assertCurrentAtDispatch: assertCurrent,
@@ -388282,6 +388388,17 @@ ${read.content}`;
388282
388388
  turn: operation.turn,
388283
388389
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
388284
388390
  });
388391
+ },
388392
+ onInferenceRouteLifecycle: (receipt) => {
388393
+ assertCurrent();
388394
+ outbound.onInferenceRouteLifecycle?.(receipt);
388395
+ this.emit({
388396
+ type: "inference_route",
388397
+ inferenceRoute: receipt,
388398
+ visibility: "telemetry",
388399
+ turn: operation.turn,
388400
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
388401
+ });
388285
388402
  }
388286
388403
  } : outbound;
388287
388404
  const response = await backend.chatCompletion(dispatchRequest);
@@ -421617,11 +421734,22 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
421617
421734
  _knownTransportContextCapability;
421618
421735
  _remoteFallback;
421619
421736
  _inferenceFallbackApprovalHandler;
421737
+ _inferenceRouteLifecycleHandler;
421738
+ setInferenceRouteLifecycleHandler(handler) {
421739
+ this._inferenceRouteLifecycleHandler = handler;
421740
+ }
421620
421741
  setInferenceFallbackApprovalHandler(handler) {
421621
421742
  this._inferenceFallbackApprovalHandler = handler;
421622
421743
  }
421623
421744
  remoteFallback() {
421624
- return this._remoteFallback ??= new RemoteInferenceFallback({ baseUrl: this.baseUrl, model: this.model, apiKey: this.apiKey, additionalSecrets: () => this._keyPool }, (route) => new _OllamaAgenticBackend(route.baseUrl, route.model, route.apiKey, false, route.protocol, route.providerId));
421745
+ return this._remoteFallback ??= new RemoteInferenceFallback({
421746
+ baseUrl: this.baseUrl,
421747
+ model: this.model,
421748
+ apiKey: this.apiKey,
421749
+ additionalSecrets: () => this._keyPool,
421750
+ providerId: this._provider.providerId,
421751
+ backendType: this._provider.protocol === "ollama" ? "ollama" : "vllm"
421752
+ }, (route) => new _OllamaAgenticBackend(route.baseUrl, route.model, route.apiKey, false, route.protocol, route.providerId));
421625
421753
  }
421626
421754
  /** Remote endpoints never reserve a GPU on this host. */
421627
421755
  usesLocalGpuAdmission() {
@@ -421641,11 +421769,21 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
421641
421769
  requestWithRunSignal(request) {
421642
421770
  const signal = mergeInferenceAbortSignals([request.signal, this._abortSignal]);
421643
421771
  const handler = this._inferenceFallbackApprovalHandler;
421644
- if (!signal && (request.onInferenceFallbackRequired || !handler))
421772
+ const routeHandler = this._inferenceRouteLifecycleHandler;
421773
+ if (!signal && !routeHandler && !request.onInferenceRouteLifecycle && (request.onInferenceFallbackRequired || !handler))
421645
421774
  return request;
421646
421775
  return {
421647
421776
  ...request,
421648
421777
  ...signal ? { signal } : {},
421778
+ ...routeHandler || request.onInferenceRouteLifecycle ? {
421779
+ logicalRequestId: request.logicalRequestId ?? crypto.randomUUID(),
421780
+ onInferenceRouteLifecycle: (receipt) => {
421781
+ signal?.throwIfAborted();
421782
+ request.assertCurrentAtDispatch?.();
421783
+ request.onInferenceRouteLifecycle?.(receipt);
421784
+ routeHandler?.(receipt);
421785
+ }
421786
+ } : {},
421649
421787
  ...request.onInferenceFallbackRequired || !handler ? {} : {
421650
421788
  onInferenceFallbackRequired: (receipt) => handler({ ...receipt, signal })
421651
421789
  }
@@ -421931,7 +422069,8 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
421931
422069
  }
421932
422070
  brokerRequestOptions(request, body, signal) {
421933
422071
  const nativeContext = request.numCtx ?? request.num_ctx;
421934
- if (request.providerDefaultOutput === true && request.maxTokens === 16384 && request.contextAdmission !== true && !(Number.isFinite(nativeContext) && (nativeContext ?? 0) > 0) && this._provider.protocol !== "anthropic-messages") {
422072
+ const remoteDefault = request.remoteProviderDefaultOutput === true && request.configuredEndpointOnly === true && this._provider.protocol === "openai-chat";
422073
+ if (request.providerDefaultOutput === true && (remoteDefault || request.maxTokens === 16384 && request.contextAdmission !== true && !(Number.isFinite(nativeContext) && (nativeContext ?? 0) > 0)) && this._provider.protocol !== "anthropic-messages") {
421935
422074
  delete body["max_tokens"];
421936
422075
  const options = body["options"];
421937
422076
  if (options && typeof options === "object" && !Array.isArray(options))
@@ -32454,6 +32454,42 @@
32454
32454
  }
32455
32455
  ]
32456
32456
  },
32457
+ {
32458
+ "id": "guide.work-orders-active-inference-route-remote-probes-20261012",
32459
+ "kind": "guide",
32460
+ "title": "Active Inference Route Remote Probes 20261012",
32461
+ "summary": "Bundled Omnius documentation artifact: docs/work-orders/active-inference-route-remote-probes-20261012.json.",
32462
+ "keywords": [
32463
+ "work",
32464
+ "orders",
32465
+ "active",
32466
+ "inference",
32467
+ "route",
32468
+ "remote",
32469
+ "probes",
32470
+ "20261012",
32471
+ "json"
32472
+ ],
32473
+ "maturity": "internal",
32474
+ "audiences": [
32475
+ "maintainer",
32476
+ "large-context-agent"
32477
+ ],
32478
+ "layer": "documentation",
32479
+ "interfaces": [
32480
+ {
32481
+ "type": "file",
32482
+ "target": "docs/work-orders/active-inference-route-remote-probes-20261012.json"
32483
+ }
32484
+ ],
32485
+ "references": [
32486
+ {
32487
+ "type": "documentation",
32488
+ "target": "docs/work-orders/active-inference-route-remote-probes-20261012.json",
32489
+ "relation": "canonical-artifact"
32490
+ }
32491
+ ]
32492
+ },
32457
32493
  {
32458
32494
  "id": "guide.work-orders-daemon-hud-ui-overhaul",
32459
32495
  "kind": "guide",
@@ -37089,6 +37125,44 @@
37089
37125
  }
37090
37126
  ]
37091
37127
  },
37128
+ {
37129
+ "id": "guide.work-orders-wo-active-inference-route-and-telegram-review-20261012-uppercase",
37130
+ "kind": "guide",
37131
+ "title": "Active inference route and Telegram completion review",
37132
+ "summary": "Status: implementation complete and verified. Publication remains with the user.",
37133
+ "keywords": [
37134
+ "work",
37135
+ "orders",
37136
+ "WO",
37137
+ "active",
37138
+ "inference",
37139
+ "route",
37140
+ "and",
37141
+ "telegram",
37142
+ "review",
37143
+ "20261012",
37144
+ "md"
37145
+ ],
37146
+ "maturity": "internal",
37147
+ "audiences": [
37148
+ "maintainer",
37149
+ "large-context-agent"
37150
+ ],
37151
+ "layer": "documentation",
37152
+ "interfaces": [
37153
+ {
37154
+ "type": "file",
37155
+ "target": "docs/work-orders/WO-active-inference-route-and-telegram-review-20261012.md"
37156
+ }
37157
+ ],
37158
+ "references": [
37159
+ {
37160
+ "type": "documentation",
37161
+ "target": "docs/work-orders/WO-active-inference-route-and-telegram-review-20261012.md",
37162
+ "relation": "canonical-artifact"
37163
+ }
37164
+ ]
37165
+ },
37092
37166
  {
37093
37167
  "id": "guide.work-orders-wo-am-gaps-uppercase",
37094
37168
  "kind": "guide",
package/docs/DISCOVERY.md CHANGED
@@ -518,6 +518,7 @@ Daemon equivalents are `GET /v1/discovery/bootstrap`, `GET /v1/discovery?q=<inte
518
518
  | `guide.trajectory-grounding` | Trajectory Grounding | Trajectory Grounding gives a running agent a compact, evidence-bound account of where a project stands, what changed, what remains uncertain, and the safest next action. Before the first main-agent request, Omnius asks the selected model to form a specific, structured orientation from that evidence. This is a control-plane checkpoint, not free-form self-talk |
519
519
  | `guide.vitepress-config` | Config | Bundled Omnius documentation artifact: docs/.vitepress/config.mts. |
520
520
  | `guide.voice-flow-architecture` | Voice TTS Flow — Architecture &amp; Implementation Guide | This document describes the voice synthesis system in omnius: how it's built, how all the pieces connect, and how to add new voice features following the same patterns. |
521
+ | `guide.work-orders-active-inference-route-remote-probes-20261012` | Active Inference Route Remote Probes 20261012 | Bundled Omnius documentation artifact: docs/work-orders/active-inference-route-remote-probes-20261012.json. |
521
522
  | `guide.work-orders-daemon-hud-ui-overhaul` | Daemon HUD UI Overhaul Work Order | Overhaul the daemon web interface using /home/roko/Desktop/hud-ui-style-kit(6)/hud-ui-style-kit as the source of truth. Preserve current daemon behavior while replacing the OpenWebUI-like rounded dashboard styling with the cold tactical HUD visual system. |
522
523
  | `guide.work-orders-hermes-architecture-deltas-01-public-scrutiny-provenance-control-index-uppercase` | Public Scrutiny Provenance Control Index | Bundled Omnius documentation artifact: docs/work-orders/hermes-architecture-deltas/01-public-scrutiny-provenance-control/INDEX.md. |
523
524
  | `guide.work-orders-hermes-architecture-deltas-01-public-scrutiny-provenance-control-workorder-uppercase` | Workorder: Public Scrutiny Provenance Control | Add a public Telegram scrutiny control plane that can elevate completion provenance checks when public accuracy risk rises, without hard-coded scenario phrases or shortcut wording that teaches the model to satisfy the gate without evidence. |
@@ -640,6 +641,7 @@ Daemon equivalents are `GET /v1/discovery/bootstrap`, `GET /v1/discovery?q=<inte
640
641
  | `guide.work-orders-telegram-progress-browser-20261011-wo-04-download-desktop-handoff-uppercase` | WO-04: Acquire browser files and expose desktop save-dialog tools | Status: complete — integrated and verified offline |
641
642
  | `guide.work-orders-telegram-progress-browser-20261011-wo-05-verification-delivery-uppercase` | WO-05: Verify the integrated repair and deliver scoped commits | Status: complete — verified offline and delivered to origin/main |
642
643
  | `guide.work-orders-telegram-reliability-consolidation-2026-09-28` | Telegram Reliability Consolidation — 2026-09-28 | Rule: check a box only after the named behavior is implemented and its listed verification passes. A parent box stays open until every child box is checked. |
644
+ | `guide.work-orders-wo-active-inference-route-and-telegram-review-20261012-uppercase` | Active inference route and Telegram completion review | Status: implementation complete and verified. Publication remains with the user. |
643
645
  | `guide.work-orders-wo-am-gaps-uppercase` | Associative Memory Gap Work Orders | Generated: 2026-04-13 Source: Deep audit of multimodal associative memory systems Status: READY FOR IMPLEMENTATION |
644
646
  | `guide.work-orders-wo-inference-fallback-20261012-uppercase` | Local inference outage fallback | Status: source implementation complete and verified. Installed-runtime activation is separate; the running daemon has not been upgraded or restarted. |
645
647
  | `guide.work-orders-wo-primary-checkout-fallback-delivery-20261012-uppercase` | Primary checkout delivery and remote output capacity | Status: implementation complete and verified in the primary checkout. Publication remains with the user. |
@@ -0,0 +1,94 @@
1
+ # Active inference route and Telegram completion review
2
+
3
+ Status: implementation complete and verified. Publication remains with the user.
4
+
5
+ ## Observed behavior
6
+
7
+ The installed 1.0.843 runtime contains the repaired fallback bundle. At 23:36
8
+ UTC, Hermes answered Telegram input 3357. A subsequent native goal assessment
9
+ failed through the remote cascade, leaving the greeting with an incomplete-task
10
+ suffix. The TUI header still displayed the configured local model throughout
11
+ remote inference.
12
+
13
+ ## Work orders and acceptance
14
+
15
+ 1. Trace the actual running process and request artifacts. Separate the primary
16
+ reply from completion-review failures; reproduce the observed transport
17
+ incompatibility before repairing it.
18
+ 2. Display the actual selected provider model and Local/Remote location in the
19
+ TUI header for both terminal and Telegram inference. Keep configured local
20
+ credentials, endpoint and model unchanged. Fence stale request callbacks.
21
+ 3. Retry the original local route automatically after its bounded outage
22
+ cooldown on real work. Restore the local display only when local inference
23
+ produces usable output. Do not generate background probe requests.
24
+ 4. Make Telegram completion reviews usable through the remote fallback while
25
+ preserving the complete response schema and host validation. Do not bypass
26
+ evidence or provider acknowledgement checks to declare success.
27
+ 5. Keep request-specific provider incompatibilities from disabling unrelated
28
+ requests. Surface bounded diagnostic classes/statuses without provider error
29
+ bodies, endpoint credentials, environment values or prompt contents.
30
+ 6. Exercise native Telegram greeting and review, route changes, streaming and
31
+ unary recovery, stale owners, cancellation, manual fallback and exhaustion.
32
+ Rebuild and verify the actual publication bundle; commit and push only this
33
+ repair while preserving unrelated working-tree edits.
34
+
35
+ ## Constraints
36
+
37
+ No Telegram messages, local inference or CUDA workloads are required for the
38
+ regressions. Synthetic remote probes may use only public catalog routes and
39
+ non-sensitive fixture text. The user handles npm publication.
40
+
41
+ ## Diagnosis and implemented behavior
42
+
43
+ The original review's per-provider errors were not retained. Synthetic probes
44
+ accepted the exact strict assessment schema. Back-to-back streamed Hermes
45
+ requests reproduced a successful first request followed by an empty HTTP 429
46
+ response with `Retry-After: 1`. The prior code immediately exhausted the cascade
47
+ and imposed a minimum 15-second provider cooldown. The native Telegram
48
+ regression reproduced the incomplete suffix before the repair.
49
+
50
+ Fallback now tries other available compatible routes, then waits for a
51
+ throttled route within the same total request deadline. It honors Retry-After,
52
+ limits each route to three attempts, and retains cancellation, ownership and
53
+ the no-replay boundary after streamed output begins. Non-429 request rejections
54
+ do not suppress unrelated requests. A 429 followed by a deterministic rejection
55
+ does not cause another retry from stale throttle state.
56
+
57
+ LLM7's `default` selector is absent from its model catalog. For keyless routes
58
+ without output/context metadata, a host-only hint selects provider output
59
+ defaults at the actual pinned OpenAI wire boundary. Complete messages, tools
60
+ and response schemas remain intact. Known-capacity routes retain the explicit
61
+ bounded output ceiling. Local request capacity is unchanged.
62
+
63
+ Host route lifecycle receipts contain only model/provider identifiers,
64
+ location, phase, request identity and bounded diagnostic category/status. The
65
+ TUI and Telegram paths deliver these receipts to the header. Local selection
66
+ establishes ownership while retaining an active remote label; usable local
67
+ success restores the local label. The existing non-sliding 15-second local
68
+ cooldown permits recovery on subsequent real work without background generation.
69
+ Explicit configuration changes invalidate older UI handlers. Display observer
70
+ failures cannot discard successful inference or trigger replay.
71
+
72
+ Synthetic probe evidence is recorded in
73
+ `active-inference-route-remote-probes-20261012.json`.
74
+
75
+ ## Verification
76
+
77
+ - All 11 workspace projects passed a clean rebuild and the staging audit.
78
+ - 350 orchestrator checks passed. The CLI run passed 203 checks and exposed an
79
+ obsolete primary-telemetry fixture that also failed on clean `14db5c33`.
80
+ Updating only that fixture to the permitted action profile and one turn
81
+ preserved every assertion and passed, bringing the selected CLI checks to
82
+ 204. No production permission or completion guard was weakened.
83
+ - The actual tarball passed its 528-file audit with zero warnings. An isolated
84
+ installation with lifecycle scripts disabled passed all 12 bundled-backend
85
+ checks: automatic/manual unary and streaming, primary-to-review throttling,
86
+ successful local recovery, and unknown-selector output defaults on the wire.
87
+ HTTP and DNS were mocked throughout these bundled checks.
88
+ - Independent review reproduced and verified the fixes for stale throttle
89
+ eligibility, the actual output-omission gate and display-observer exceptions.
90
+
91
+ The isolated bundle check does not establish a working native installation:
92
+ the user's ordinary fresh-install gate subsequently reported a required
93
+ `node-datachannel` native-build failure. That installer repair is separate work
94
+ and remains necessary before publication.
@@ -0,0 +1,34 @@
1
+ {
2
+ "schema": "omnius.inference-route-incident-evidence.v1",
3
+ "date": "2026-10-12",
4
+ "installedVersion": "1.0.843",
5
+ "installedBundleSha256": "1c020e46538ba5a79d1d2b7586f2f8922b0f4bab36354bd878b49939461d8d9b",
6
+ "incident": {
7
+ "inputMessageId": 3357,
8
+ "runId": "telegram:e6eb632a9f3e0acd",
9
+ "primaryFallbackProvider": "hermes",
10
+ "primaryFallbackSucceededAt": "2026-10-12T23:36:17.680Z",
11
+ "nativeGoalAssessment": "unavailable",
12
+ "originalProviderFailureBodiesAvailable": false
13
+ },
14
+ "syntheticRemoteProbes": [
15
+ { "provider": "hermes", "transport": "unary", "format": "exact native assessment schema", "status": 200, "conformingJson": true },
16
+ { "provider": "hermes", "transport": "stream", "format": "exact native assessment schema", "status": 200, "sseFrames": 43, "done": true },
17
+ { "provider": "hermes", "transport": "stream", "timing": "immediately after successful identical request", "status": 429, "retryAfterSeconds": 1, "emptyBody": true },
18
+ { "provider": "llm7", "transport": "stream", "format": "small strict schema", "status": 200, "visibleContent": true, "done": true },
19
+ { "provider": "ovh_ai_endpoints", "transport": "stream", "format": "small strict schema", "status": 200, "visibleContent": false, "done": true, "outputCeiling": 128 }
20
+ ],
21
+ "catalogs": {
22
+ "hermes": { "model": "turboderp/Qwen3.8-27B-exl3", "max_model_len": 65536 },
23
+ "llm7": { "modelCount": 65, "selector": "default", "selectorPresentInCatalog": false },
24
+ "ovh_ai_endpoints": { "model": "gpt-oss-20b", "context_length": 131072, "max_completion_tokens": 131072 }
25
+ },
26
+ "limits": [
27
+ "The original review's per-provider HTTP errors were not durably retained; the throttling probe reproduces a concrete failure path without proving every original provider error.",
28
+ "The OVH probe used an intentionally small output ceiling and does not establish failure with a normal output allowance."
29
+ ],
30
+ "userContextSentByProbes": false,
31
+ "credentialsSentByProbes": false,
32
+ "localInferenceRequests": 0,
33
+ "telegramMessagesSent": 0
34
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.843",
3
+ "version": "1.0.845",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.843",
9
+ "version": "1.0.845",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.843",
3
+ "version": "1.0.845",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/library.js",