omnius 1.0.846 → 1.0.847

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: 37075842 bytes
4
- sha256: f568a8a54e037eb22f21193f7f589f8769b6b94369c0e9dfa7446ca6e8a5f87b
3
+ size: 37088449 bytes
4
+ sha256: f5581b26f6b472a9af893e906670aabb393bc4c63944d2daeadbec245809eb01
package/dist/library.js CHANGED
@@ -342649,8 +342649,31 @@ var FREE_INFERENCE_SEEDS = Object.freeze([
342649
342649
  modelsUrl: "https://oai.endpoints.kepler.ai.cloud.ovh.net/v1/models",
342650
342650
  model: "gpt-oss-20b",
342651
342651
  nativeToolsHint: true
342652
+ }),
342653
+ Object.freeze({
342654
+ id: "chat",
342655
+ name: "ch.at",
342656
+ chatUrl: "https://ch.at/v1/chat/completions",
342657
+ model: "provider-default",
342658
+ nativeToolsHint: false,
342659
+ providerDefaultModel: true
342652
342660
  })
342653
342661
  ]);
342662
+ function mergeKeylessInferenceProviders(discovered) {
342663
+ const routes = new Map(FREE_INFERENCE_SEEDS.map((provider) => [provider.chatUrl, { ...provider }]));
342664
+ for (const provider of discovered) {
342665
+ const known = routes.get(provider.chatUrl);
342666
+ if (!known)
342667
+ routes.set(provider.chatUrl, { ...provider });
342668
+ else if (known.id === provider.id && known.modelsUrl === provider.modelsUrl)
342669
+ routes.set(provider.chatUrl, {
342670
+ ...provider,
342671
+ ...known,
342672
+ nativeToolsHint: known.nativeToolsHint || provider.nativeToolsHint
342673
+ });
342674
+ }
342675
+ return [...routes.values()];
342676
+ }
342654
342677
  var object2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
342655
342678
  var boundedString3 = (value, max = 256) => typeof value === "string" && value.length > 0 && value.length <= max && !/[\u0000-\u001f\u007f]/.test(value);
342656
342679
  function publicHttpsSyntax(value) {
@@ -342704,11 +342727,12 @@ function parseKeylessInferenceRegistry(html) {
342704
342727
  continue;
342705
342728
  const chat = provider.endpoints.find((e) => object2(e) && e.method === "POST" && typeof e.url === "string" && e.url.endsWith("/chat/completions"));
342706
342729
  const models = provider.endpoints.find((e) => object2(e) && e.method === "GET" && typeof e.url === "string" && e.url.endsWith("/models"));
342707
- if (!object2(chat) || !object2(models))
342730
+ if (!object2(chat))
342708
342731
  continue;
342709
342732
  const chatUrl = publicHttpsSyntax(chat.url);
342710
- const modelsUrl = publicHttpsSyntax(models.url);
342711
- if (!chatUrl || !modelsUrl || new URL(chatUrl).origin !== new URL(modelsUrl).origin)
342733
+ const modelsUrl = object2(models) ? publicHttpsSyntax(models.url) : void 0;
342734
+ const pinnedDefault = FREE_INFERENCE_SEEDS.find((seed) => seed.providerDefaultModel && seed.id === provider.id && seed.chatUrl === chatUrl);
342735
+ if (!chatUrl || !modelsUrl && !pinnedDefault || modelsUrl && new URL(chatUrl).origin !== new URL(modelsUrl).origin)
342712
342736
  continue;
342713
342737
  if (sentinel && new URL(chatUrl).origin !== "https://api.llm7.io")
342714
342738
  continue;
@@ -342717,9 +342741,10 @@ function parseKeylessInferenceRegistry(html) {
342717
342741
  id: provider.id,
342718
342742
  name: boundedString3(provider.name, 80) ? provider.name : provider.id,
342719
342743
  chatUrl,
342720
- modelsUrl,
342721
- model: boundedString3(example.model) ? example.model : "",
342744
+ ...modelsUrl ? { modelsUrl } : {},
342745
+ model: pinnedDefault?.model ?? (boundedString3(example.model) ? example.model : ""),
342722
342746
  nativeToolsHint: provider.capabilities.some((cap) => cap === "function_calling_on_supported_models" || cap === "tools_on_supported_models"),
342747
+ ...pinnedDefault ? { providerDefaultModel: true, nativeToolsHint: false } : {},
342723
342748
  ...sentinel ? { anonymousAuthorization: "Bearer unused" } : {}
342724
342749
  });
342725
342750
  if (providers.length >= MAX_ROUTES)
@@ -349052,6 +349077,7 @@ var localCooldowns = /* @__PURE__ */ new Map();
349052
349077
  var registryCaches = /* @__PURE__ */ new WeakMap();
349053
349078
  var catalogCaches = /* @__PURE__ */ new WeakMap();
349054
349079
  var MAX_ROUTES2 = 6;
349080
+ var MAX_MODELS_PER_PROVIDER = 3;
349055
349081
  var MAX_REGISTRY_BYTES = 1048576;
349056
349082
  var MAX_CATALOG_BYTES = 262144;
349057
349083
  var MAX_REQUEST_BYTES = 2097152;
@@ -349121,6 +349147,12 @@ function publicHttps(value) {
349121
349147
  function hasImages(request) {
349122
349148
  return request.messages.some((message) => Array.isArray(message.content) && message.content.some((part) => object4(part) && (String(part.type) === "image_url" || String(part.type) === "image")));
349123
349149
  }
349150
+ function chatCatalogModel(model) {
349151
+ if (!object4(model) || typeof model.id !== "string" || !/^[A-Za-z0-9_./:+@-]{1,200}$/.test(model.id) || model.max_completion_tokens === 0 || model.usage_based_only === true || model.model_type !== void 0 && model.model_type !== "chat" || /embedding|^bge-|^whisper|^flux|qwen\d*guard|(?:^|[/_-])(?:llama[-_])?guard(?:[-_/]|$)|moderation/i.test(model.id))
349152
+ return false;
349153
+ const modalities = object4(model.modalities) ? model.modalities : void 0;
349154
+ return !modalities || (!Array.isArray(modalities.input) || modalities.input.includes("text")) && (!Array.isArray(modalities.output) || modalities.output.includes("text"));
349155
+ }
349124
349156
  var RemoteInferenceFallback = class _RemoteInferenceFallback {
349125
349157
  primary;
349126
349158
  makeBackend;
@@ -349531,6 +349563,7 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349531
349563
  ...route.contextWindow || route.maxOutputTokens ? { providerDefaultOutput: void 0 } : route.keyless ? { providerDefaultOutput: true, remoteProviderDefaultOutput: true } : {},
349532
349564
  preferNativeOllamaChat: false,
349533
349565
  think: false,
349566
+ remoteProviderDefaultModel: route.keyless?.providerDefaultModel ? true : void 0,
349534
349567
  ...route.keyless?.directAnswer ? { chatTemplateKwargs: { enable_thinking: false } } : {},
349535
349568
  timeoutMs: Math.min(request.timeoutMs, this.policy.requestTimeoutMs)
349536
349569
  };
@@ -349668,7 +349701,8 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349668
349701
  this.fence(request);
349669
349702
  registryCaches.set(fetcher, { until: this.now() + 15e3, providers: [] });
349670
349703
  }
349671
- for (const provider of [...FREE_INFERENCE_SEEDS, ...discovered]) {
349704
+ const alternatives = [];
349705
+ for (const provider of mergeKeylessInferenceProviders(discovered)) {
349672
349706
  this.fence(request);
349673
349707
  if (this.now() >= deadline || count2 >= MAX_ROUTES2)
349674
349708
  return;
@@ -349684,50 +349718,88 @@ var RemoteInferenceFallback = class _RemoteInferenceFallback {
349684
349718
  keyless: provider,
349685
349719
  ...provider.anonymousAuthorization === "Bearer unused" ? { apiKey: "unused" } : {}
349686
349720
  };
349687
- if (seen.has(routeKey(route)) || !this.compatible(request, route, includeCooling))
349721
+ if (!this.compatible(request, route, includeCooling))
349722
+ continue;
349723
+ if (provider.providerDefaultModel) {
349724
+ const key = routeKey(route);
349725
+ if (!seen.has(key)) {
349726
+ seen.add(key);
349727
+ count2++;
349728
+ yield route;
349729
+ }
349730
+ continue;
349731
+ }
349732
+ const modelsUrl = provider.modelsUrl;
349733
+ if (!modelsUrl)
349688
349734
  continue;
349689
- seen.add(routeKey(route));
349690
349735
  try {
349691
349736
  let cache3 = catalogCaches.get(fetcher);
349692
349737
  if (!cache3) {
349693
349738
  cache3 = /* @__PURE__ */ new Map();
349694
349739
  catalogCaches.set(fetcher, cache3);
349695
349740
  }
349696
- const cached = cache3.get(provider.modelsUrl);
349697
- const raw = cached && cached.until > this.now() ? cached.value : JSON.parse(await this.read(provider.modelsUrl, request, deadline, MAX_CATALOG_BYTES));
349741
+ const cached = cache3.get(modelsUrl);
349742
+ const raw = cached && cached.until > this.now() ? cached.value : JSON.parse(await this.read(modelsUrl, request, deadline, MAX_CATALOG_BYTES));
349698
349743
  if (!object4(raw) || !Array.isArray(raw.data) || raw.data.length > 512)
349699
349744
  continue;
349700
349745
  if (cache3.size >= 64)
349701
349746
  cache3.delete(cache3.keys().next().value);
349702
- cache3.set(provider.modelsUrl, { until: this.now() + 3e5, value: raw });
349703
- const models = raw.data.filter((model) => object4(model) && typeof model.id === "string" && /^[A-Za-z0-9_./:+@-]{1,200}$/.test(model.id) && model.max_completion_tokens !== 0 && model.model_type !== "embedding" && !/embedding|^bge-|^whisper|^flux/i.test(model.id));
349704
- const selected = models.find((model) => model.id === route.model) ?? (provider.selector ? void 0 : models[0]);
349705
- if (!selected && !provider.selector)
349706
- continue;
349707
- if (selected) {
349708
- route.model = String(selected.id);
349709
- const window2 = selected.context_length ?? selected.context_window ?? selected.max_model_len;
349710
- if (typeof window2 === "number" && Number.isSafeInteger(window2) && window2 > 0)
349711
- route.contextWindow = window2;
349712
- const output = selected.max_completion_tokens;
349713
- if (typeof output === "number" && Number.isSafeInteger(output) && output > 0)
349714
- route.maxOutputTokens = output;
349715
- if (Array.isArray(selected.supported_parameters) && request.tools.length && !selected.supported_parameters.includes("tools"))
349747
+ cache3.set(modelsUrl, { until: this.now() + 3e5, value: raw });
349748
+ const models = raw.data.filter(chatCatalogModel);
349749
+ const unique4 = [...new Map(models.map((model) => [String(model.id), model])).values()];
349750
+ const preferred = unique4.find((model) => model.id === route.model);
349751
+ const ordered = [
349752
+ ...preferred ? [preferred] : provider.selector ? [void 0] : [],
349753
+ ...unique4.filter((model) => model !== preferred).sort((a, b) => String(a.id) < String(b.id) ? -1 : String(a.id) > String(b.id) ? 1 : 0)
349754
+ ];
349755
+ const compatible = [];
349756
+ for (const selected of ordered) {
349757
+ const candidate = { ...route, ...selected ? { model: String(selected.id) } : {} };
349758
+ if (selected) {
349759
+ const capabilities = object4(selected.capabilities) ? selected.capabilities : void 0;
349760
+ if (request.tools.length && (selected.tools_calling === false || capabilities?.tools === false || Array.isArray(selected.supported_parameters) && !selected.supported_parameters.includes("tools")))
349761
+ continue;
349762
+ if ((request.responseFormat ?? request.response_format) && (selected.json_mode === false || capabilities?.json_mode === false))
349763
+ continue;
349764
+ const nestedWindow = object4(selected.context_window) ? selected.context_window.tokens : selected.context_window;
349765
+ const window2 = [selected.context_length, nestedWindow, selected.max_model_len].find((value) => typeof value === "number" && Number.isSafeInteger(value) && value > 0);
349766
+ if (typeof window2 === "number")
349767
+ candidate.contextWindow = window2;
349768
+ const output = selected.max_completion_tokens;
349769
+ if (typeof output === "number" && Number.isSafeInteger(output) && output > 0)
349770
+ candidate.maxOutputTokens = output;
349771
+ }
349772
+ if (!candidate.model || seen.has(routeKey(candidate)) || !this.compatible(request, candidate, includeCooling))
349716
349773
  continue;
349774
+ compatible.push(candidate);
349775
+ if (compatible.length >= MAX_MODELS_PER_PROVIDER)
349776
+ break;
349717
349777
  }
349718
- if (!route.model || !this.compatible(request, route, includeCooling))
349778
+ const first = compatible.shift();
349779
+ if (!first)
349719
349780
  continue;
349720
- const actualKey = routeKey(route);
349721
- if (actualKey !== `${new URL(route.baseUrl).origin}\0${provider.model}` && seen.has(actualKey))
349722
- continue;
349723
- seen.add(actualKey);
349724
- yield route;
349781
+ alternatives.push(compatible);
349782
+ seen.add(routeKey(first));
349725
349783
  count2++;
349784
+ yield first;
349726
349785
  } catch {
349727
349786
  this.fence(request);
349728
349787
  this.cooldown(route, void 0);
349729
349788
  }
349730
349789
  }
349790
+ while (alternatives.some((routes) => routes.length)) {
349791
+ for (const routes of alternatives) {
349792
+ this.fence(request);
349793
+ if (this.now() >= deadline || count2 >= MAX_ROUTES2)
349794
+ return;
349795
+ const route = routes.shift();
349796
+ if (!route || seen.has(routeKey(route)) || !this.compatible(request, route, includeCooling))
349797
+ continue;
349798
+ seen.add(routeKey(route));
349799
+ count2++;
349800
+ yield route;
349801
+ }
349802
+ }
349731
349803
  }
349732
349804
  read(url, request, deadline, limit2) {
349733
349805
  return this.attempt(request, Math.min(5e3, this.policy.requestTimeoutMs, deadline - this.now()), async (bounded3) => {
@@ -386366,6 +386438,7 @@ runtime_module_sha256=${record8.runtimeProvenance.module.sha256 ?? "unknown"}`
386366
386438
  maxTurns: options?.maxTurns ?? 60,
386367
386439
  continueOnDurableWorkProgress: options?.continueOnDurableWorkProgress ?? options?.maxTurns === void 0,
386368
386440
  acceptTextOnlyCompletion: options?.acceptTextOnlyCompletion ?? false,
386441
+ admitTextOnlyCompletionCandidate: options?.admitTextOnlyCompletionCandidate,
386369
386442
  expectedOutcomeContract,
386370
386443
  taskObjectiveContract,
386371
386444
  taskWorkPlan: options?.taskWorkPlan,
@@ -406165,6 +406238,7 @@ ${dynamicProjectContext}`
406165
406238
  const sameResponseTelegramCompletionReplies = /* @__PURE__ */ new Map();
406166
406239
  const telegramOnlyCompletionCallIds = /* @__PURE__ */ new Set();
406167
406240
  let acceptedVisibleConversationResponse = false;
406241
+ let acceptedHostTextCompletion = false;
406168
406242
  const currentTelegramCompletionObjectiveScope = () => {
406169
406243
  return this._telegramCompletionObjectiveScope();
406170
406244
  };
@@ -413008,7 +413082,85 @@ ${transportFailure2}` : transportFailure2;
413008
413082
  });
413009
413083
  const cleanNonStream = content.replace(/<think>[\s\S]*?<\/think>/g, "").trim();
413010
413084
  this.emitModelAssistantText(cleanNonStream, turn);
413011
- const textOnlyCompletionAllowed = this.options.acceptTextOnlyCompletion && expectedOutcomeAllowsTextOnlyCompletion(this.options.expectedOutcomeContract);
413085
+ const admitTextCandidate = this.options.admitTextOnlyCompletionCandidate;
413086
+ const textCandidate = this._latestModelVisibleAssistantText;
413087
+ if (this._isTelegramSurface() && admitTextCandidate && cleanNonStream && !isThinkOnly && this.options.expectedOutcomeContract?.requiredEffects.includes("visible_response") === true && textCandidate?.text === cleanNonStream && textCandidate.turn === turn && !this._pendingSteeringPreemption && !this._hasUnresolvedCurrentSteeringInputs() && !this.pendingUserMessages.length && !this.taskRequirementInterpretationPending) {
413088
+ const runController = this._abortController, turnController = this._turnAbortController;
413089
+ const signal = AbortSignal.any([runController.signal, turnController.signal]);
413090
+ const assertCurrent = () => {
413091
+ signal.throwIfAborted();
413092
+ const interruption = this._interruptionLifecycle?.snapshot();
413093
+ if (this.aborted || this._paused || this._abortController !== runController || this._turnAbortController !== turnController || this._latestModelVisibleAssistantText !== textCandidate || textCandidate.runId !== this.currentArtifactRunId() || textCandidate.taskEpoch !== this._taskEpoch || textCandidate.turn !== turn || textCandidate.text !== cleanNonStream || textCandidate.objectiveScope !== currentTelegramCompletionObjectiveScope() || textCandidate.objectiveFingerprint !== this._objectiveFrontier?.fingerprint || this._pendingSteeringPreemption || this._hasUnresolvedCurrentSteeringInputs() || this.pendingUserMessages.length || this.taskRequirementInterpretationPending || interruption && (interruption.phase !== "running" || interruption.pendingAcknowledgements.some((operation) => operation.status === "pending") || interruption.ambiguousEffects.some((effect) => effect.state === "unknown_after_interrupt")))
413094
+ throw new Error("Host-reviewed assistant reply is no longer current");
413095
+ };
413096
+ let onAbort;
413097
+ try {
413098
+ assertCurrent();
413099
+ const admission = Promise.resolve().then(() => {
413100
+ assertCurrent();
413101
+ return admitTextCandidate(Object.freeze({
413102
+ text: cleanNonStream,
413103
+ runId: textCandidate.runId,
413104
+ taskEpoch: textCandidate.taskEpoch,
413105
+ turn,
413106
+ signal,
413107
+ assertCurrent
413108
+ }));
413109
+ });
413110
+ const admitted = await Promise.race([admission, new Promise((_resolve, reject) => {
413111
+ onAbort = () => reject(signal.reason);
413112
+ if (signal.aborted)
413113
+ onAbort();
413114
+ else
413115
+ signal.addEventListener("abort", onAbort, { once: true });
413116
+ })]);
413117
+ assertCurrent();
413118
+ if (admitted === true) {
413119
+ acceptedCompletionReply = {
413120
+ ...textCandidate,
413121
+ text: cleanNonStream,
413122
+ toolCallId: `host-visible-response:${crypto.randomUUID()}`,
413123
+ source: "host_reviewed_model_visible_text"
413124
+ };
413125
+ acceptedHostTextCompletion = true;
413126
+ acceptedVisibleConversationResponse = true;
413127
+ completed = true;
413128
+ summary = cleanNonStream;
413129
+ this._onTypedEvent?.({
413130
+ type: "completion_requested",
413131
+ runId: this.currentArtifactRunId(),
413132
+ summary: cleanNonStream.slice(0, 500),
413133
+ sourcePath: this.options.streamEnabled ? "stream" : "batch",
413134
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
413135
+ });
413136
+ break;
413137
+ }
413138
+ if (admitted && typeof admitted === "object" && admitted.admitted === false && typeof admitted.feedback === "string") {
413139
+ const feedback = this.scrubUserInput(admitted.feedback, "host-text-completion-review").trim().slice(0, 4e3);
413140
+ if (feedback)
413141
+ messages.push({ role: "system", content: feedback });
413142
+ }
413143
+ } catch (error) {
413144
+ if (this.aborted || runController.signal.aborted)
413145
+ break;
413146
+ if (this._pendingSteeringPreemption || this._immediateSteeringWakeInputId || this._hasUnresolvedCurrentSteeringInputs() || this.pendingUserMessages.length || this.taskRequirementInterpretationPending) {
413147
+ this.emit({
413148
+ type: "status",
413149
+ content: "Plain assistant reply admission interrupted by current user steering; entering the next safe boundary.",
413150
+ turn,
413151
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
413152
+ });
413153
+ continue;
413154
+ }
413155
+ if (signal.aborted)
413156
+ break;
413157
+ throw error;
413158
+ } finally {
413159
+ if (onAbort)
413160
+ signal.removeEventListener("abort", onAbort);
413161
+ }
413162
+ }
413163
+ const textOnlyCompletionAllowed = !(this._isTelegramSurface() && admitTextCandidate) && this.options.acceptTextOnlyCompletion && expectedOutcomeAllowsTextOnlyCompletion(this.options.expectedOutcomeContract);
413012
413164
  if (this._isTelegramSurface() && textOnlyCompletionAllowed && cleanNonStream) {
413013
413165
  const beforeVisibleResponse = this._currentExpectedOutcomeAssessment();
413014
413166
  if (beforeVisibleResponse?.missingEffects.length && beforeVisibleResponse.missingEffects.every((effect) => effect === "visible_response")) {
@@ -413955,7 +414107,7 @@ ${terminalFeedback.slice(0, 4e3)}`,
413955
414107
  });
413956
414108
  }
413957
414109
  const completionHadIndependentVerificationFailure = Boolean(finalAuthoritativeDeficit || this._completionIncompleteVerification);
413958
- const taskCompleteRequiresVisibleResponse = this._isTelegramSurface() && acceptedTaskCompleteStatus !== void 0 && this.options.expectedOutcomeContract?.requiredEffects.includes("visible_response") === true;
414110
+ const taskCompleteRequiresVisibleResponse = this._isTelegramSurface() && (acceptedTaskCompleteStatus !== void 0 || acceptedHostTextCompletion) && this.options.expectedOutcomeContract?.requiredEffects.includes("visible_response") === true;
413959
414111
  const taskCompleteOwnsAcceptedReply = acceptedCompletionReply?.source === "task_complete_user_reply" && acceptedCompletionReply.runId === this.currentArtifactRunId() && acceptedCompletionReply.taskEpoch === this._taskEpoch && acceptedCompletionReply.objectiveScope === currentTelegramCompletionObjectiveScope();
413960
414112
  const hasTelegramDeliveryReceipt = this._isTelegramSurface() && [...this._completionDeliveryReceipts.values()].some((receipt) => receipt.provider.trim().toLowerCase() === "telegram");
413961
414113
  if (completed && !declaredDegradedCompletion && taskCompleteRequiresVisibleResponse && !taskCompleteOwnsAcceptedReply && !hasTelegramDeliveryReceipt) {
@@ -413995,9 +414147,9 @@ ${terminalFeedback.slice(0, 4e3)}`,
413995
414147
  expectedOutcomeAssessment,
413996
414148
  override: acceptedTaskCompleteOverride
413997
414149
  });
413998
- const providerDeliveryIsOnlyRemainingEffect = Boolean(this._isTelegramSurface() && taskCompleteRequiresVisibleResponse && !hasTelegramDeliveryReceipt && (acceptedCompletionReply?.source === "task_complete_user_reply" || acceptedCompletionReply?.source === "same_response_model_visible_text" || acceptedCompletionReply?.source === "prior_response_model_visible_text") && expectedOutcomeAssessment && !expectedOutcomeAssessment.satisfied && expectedOutcomeAssessment.missingEffects.length === 1 && expectedOutcomeAssessment.missingEffects[0] === "visible_response" && expectedOutcomeAssessment.requiredEffects.every((effect) => effect === "visible_response" || expectedOutcomeAssessment.observedEffects.includes(effect)) && completionReadinessAllowsExpectedEffectReply(completionReadiness));
413999
- const canonicalProviderDeliveryIsPending = Boolean(this._isTelegramSurface() && !declaredDegradedCompletion && !hasTelegramDeliveryReceipt && !completionHadIndependentVerificationFailure && !this._terminalRuntimeFailure && !this.aborted && !this.taskRequirementInterpretationPending && !this._interruptionLifecycle?.snapshot().pendingAcknowledgements.some((operation) => operation.status === "pending") && !this._interruptionLifecycle?.snapshot().ambiguousEffects.some((effect) => effect.state === "unknown_after_interrupt") && acceptedCompletionReply && acceptedCompletionReply.runId === this.currentArtifactRunId() && acceptedCompletionReply.taskEpoch === this._taskEpoch && acceptedCompletionReply.objectiveScope === currentTelegramCompletionObjectiveScope() && (acceptedCompletionReply.source === "task_complete_user_reply" || acceptedCompletionReply.source === "same_response_model_visible_text" || acceptedCompletionReply.source === "prior_response_model_visible_text") && completionReadinessAllowsCanonicalProviderDelivery(completionReadiness, this.getTaskExecutionSnapshot(), acceptedCompletionReply.text));
414000
- const providerDeliveryEffectsArePending = canonicalProviderDeliveryIsPending || Boolean(this._telegramPendingProviderDeliveryFrontierIsCurrent() && !declaredDegradedCompletion && !hasTelegramDeliveryReceipt && !completionHadIndependentVerificationFailure && acceptedCompletionReply && acceptedCompletionReply.runId === this.currentArtifactRunId() && acceptedCompletionReply.taskEpoch === this._taskEpoch && acceptedCompletionReply.objectiveScope === currentTelegramCompletionObjectiveScope() && acceptedCompletionReply.objectiveFingerprint === this._objectiveFrontier?.fingerprint && (acceptedCompletionReply.source === "task_complete_user_reply" || acceptedCompletionReply.source === "same_response_model_visible_text" || acceptedCompletionReply.source === "prior_response_model_visible_text") && completionReadinessAllowsPendingProviderDelivery(completionReadiness));
414150
+ const providerDeliveryIsOnlyRemainingEffect = Boolean(this._isTelegramSurface() && taskCompleteRequiresVisibleResponse && !hasTelegramDeliveryReceipt && (acceptedCompletionReply?.source === "task_complete_user_reply" || acceptedCompletionReply?.source === "same_response_model_visible_text" || acceptedCompletionReply?.source === "prior_response_model_visible_text" || acceptedCompletionReply?.source === "host_reviewed_model_visible_text") && expectedOutcomeAssessment && !expectedOutcomeAssessment.satisfied && expectedOutcomeAssessment.missingEffects.length === 1 && expectedOutcomeAssessment.missingEffects[0] === "visible_response" && expectedOutcomeAssessment.requiredEffects.every((effect) => effect === "visible_response" || expectedOutcomeAssessment.observedEffects.includes(effect)) && completionReadinessAllowsExpectedEffectReply(completionReadiness));
414151
+ const canonicalProviderDeliveryIsPending = Boolean(this._isTelegramSurface() && !declaredDegradedCompletion && !hasTelegramDeliveryReceipt && !completionHadIndependentVerificationFailure && !this._terminalRuntimeFailure && !this.aborted && !this.taskRequirementInterpretationPending && !this._interruptionLifecycle?.snapshot().pendingAcknowledgements.some((operation) => operation.status === "pending") && !this._interruptionLifecycle?.snapshot().ambiguousEffects.some((effect) => effect.state === "unknown_after_interrupt") && acceptedCompletionReply && acceptedCompletionReply.runId === this.currentArtifactRunId() && acceptedCompletionReply.taskEpoch === this._taskEpoch && acceptedCompletionReply.objectiveScope === currentTelegramCompletionObjectiveScope() && (acceptedCompletionReply.source === "task_complete_user_reply" || acceptedCompletionReply.source === "same_response_model_visible_text" || acceptedCompletionReply.source === "prior_response_model_visible_text" || acceptedCompletionReply.source === "host_reviewed_model_visible_text") && completionReadinessAllowsCanonicalProviderDelivery(completionReadiness, this.getTaskExecutionSnapshot(), acceptedCompletionReply.text));
414152
+ const providerDeliveryEffectsArePending = canonicalProviderDeliveryIsPending || Boolean(this._telegramPendingProviderDeliveryFrontierIsCurrent() && !declaredDegradedCompletion && !hasTelegramDeliveryReceipt && !completionHadIndependentVerificationFailure && acceptedCompletionReply && acceptedCompletionReply.runId === this.currentArtifactRunId() && acceptedCompletionReply.taskEpoch === this._taskEpoch && acceptedCompletionReply.objectiveScope === currentTelegramCompletionObjectiveScope() && acceptedCompletionReply.objectiveFingerprint === this._objectiveFrontier?.fingerprint && (acceptedCompletionReply.source === "task_complete_user_reply" || acceptedCompletionReply.source === "same_response_model_visible_text" || acceptedCompletionReply.source === "prior_response_model_visible_text" || acceptedCompletionReply.source === "host_reviewed_model_visible_text") && completionReadinessAllowsPendingProviderDelivery(completionReadiness));
414001
414153
  const attemptedSuccessfulTerminal = !declaredDegradedCompletion && (completed || acceptedTaskCompleteStatus === "completed" || acceptedTaskCompleteStatus === "no_changes_required");
414002
414154
  if (this._completionReadinessMode === "shadow") {
414003
414155
  const integrityKey = loadRuntimeRolloutIntegrityKey(this.omniusStateDir());
@@ -415112,7 +415264,7 @@ Result: ${summary.slice(0, 330)}`,
415112
415264
  runId: terminalReceipt.runId,
415113
415265
  terminalReceiptId: terminalReceipt.id
415114
415266
  } : void 0,
415115
- deliverableUserReply: terminalReceipt && (acceptedCompletionReply?.source === "task_complete_user_reply" || acceptedCompletionReply?.source === "same_response_model_visible_text" || acceptedCompletionReply?.source === "prior_response_model_visible_text") && acceptedCompletionReply.taskEpoch === terminalReceipt.taskEpoch && (declaredIncompleteReplyIsCurrent || !declaredDegradedCompletion && (providerDeliveryEffectsArePending || completionReadinessAllowsExpectedEffectReply(completionReadiness) && (providerDeliveryIsOnlyRemainingEffect || !completionHadIndependentVerificationFailure))) ? {
415267
+ deliverableUserReply: terminalReceipt && (acceptedCompletionReply?.source === "task_complete_user_reply" || acceptedCompletionReply?.source === "same_response_model_visible_text" || acceptedCompletionReply?.source === "prior_response_model_visible_text" || acceptedCompletionReply?.source === "host_reviewed_model_visible_text") && (acceptedCompletionReply.source !== "host_reviewed_model_visible_text" || providerDeliveryIsOnlyRemainingEffect || providerDeliveryEffectsArePending) && acceptedCompletionReply.taskEpoch === terminalReceipt.taskEpoch && (declaredIncompleteReplyIsCurrent || !declaredDegradedCompletion && (providerDeliveryEffectsArePending || completionReadinessAllowsExpectedEffectReply(completionReadiness) && (providerDeliveryIsOnlyRemainingEffect || !completionHadIndependentVerificationFailure))) ? {
415116
415268
  text: acceptedCompletionReply.text,
415117
415269
  toolCallId: acceptedCompletionReply.toolCallId,
415118
415270
  taskEpoch: acceptedCompletionReply.taskEpoch,
@@ -422069,6 +422221,8 @@ var OllamaAgenticBackend = class _OllamaAgenticBackend {
422069
422221
  }
422070
422222
  brokerRequestOptions(request, body, signal) {
422071
422223
  const nativeContext = request.numCtx ?? request.num_ctx;
422224
+ if (request.remoteProviderDefaultModel === true && request.configuredEndpointOnly === true && this._provider.protocol === "openai-chat")
422225
+ delete body["model"];
422072
422226
  const remoteDefault = request.remoteProviderDefaultOutput === true && request.configuredEndpointOnly === true && this._provider.protocol === "openai-chat";
422073
422227
  if (request.providerDefaultOutput === true && (remoteDefault || request.maxTokens === 16384 && request.contextAdmission !== true && !(Number.isFinite(nativeContext) && (nativeContext ?? 0) > 0)) && this._provider.protocol !== "anthropic-messages") {
422074
422228
  delete body["max_tokens"];
@@ -37336,6 +37336,44 @@
37336
37336
  }
37337
37337
  ]
37338
37338
  },
37339
+ {
37340
+ "id": "guide.work-orders-wo-telegram-plain-answer-and-provider-catalog-20261012-uppercase",
37341
+ "kind": "guide",
37342
+ "title": "Preserve native Telegram answers and use compatible free inference routes",
37343
+ "summary": "Status: implemented and verified. The user owns publication and runtime replacement.",
37344
+ "keywords": [
37345
+ "work",
37346
+ "orders",
37347
+ "WO",
37348
+ "telegram",
37349
+ "plain",
37350
+ "answer",
37351
+ "and",
37352
+ "provider",
37353
+ "catalog",
37354
+ "20261012",
37355
+ "md"
37356
+ ],
37357
+ "maturity": "internal",
37358
+ "audiences": [
37359
+ "maintainer",
37360
+ "large-context-agent"
37361
+ ],
37362
+ "layer": "documentation",
37363
+ "interfaces": [
37364
+ {
37365
+ "type": "file",
37366
+ "target": "docs/work-orders/WO-telegram-plain-answer-and-provider-catalog-20261012.md"
37367
+ }
37368
+ ],
37369
+ "references": [
37370
+ {
37371
+ "type": "documentation",
37372
+ "target": "docs/work-orders/WO-telegram-plain-answer-and-provider-catalog-20261012.md",
37373
+ "relation": "canonical-artifact"
37374
+ }
37375
+ ]
37376
+ },
37339
37377
  {
37340
37378
  "id": "guide.work-orders-wo-telegram-unavailable-review-presentation-20261012-uppercase",
37341
37379
  "kind": "guide",
package/docs/DISCOVERY.md CHANGED
@@ -647,6 +647,7 @@ Daemon equivalents are `GET /v1/discovery/bootstrap`, `GET /v1/discovery?q=<inte
647
647
  | `guide.work-orders-wo-native-transport-fresh-install-20261012-uppercase` | Native transport failure in the fresh npm installation gate | Status: implemented and verified. Publication remains with the user. |
648
648
  | `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. |
649
649
  | `guide.work-orders-wo-telegram-fallback-20261012-uppercase` | Telegram outage fallback and user-selected approval mode | Status: implementation complete; distributable verification recorded below. Publication and runtime installation are reserved for the user. |
650
+ | `guide.work-orders-wo-telegram-plain-answer-and-provider-catalog-20261012-uppercase` | Preserve native Telegram answers and use compatible free inference routes | Status: implemented and verified. The user owns publication and runtime replacement. |
650
651
  | `guide.work-orders-wo-telegram-unavailable-review-presentation-20261012-uppercase` | Telegram reply presentation when an auxiliary review is unavailable | Status: implemented and verified. Publication and runtime replacement remain with the user. |
651
652
  | `guide.work-orders-world-class-memory-compiler-readme-uppercase` | World-Class Memory Compiler Program | Status: active implementation program Owner: Omnius orchestration and memory packages Last updated: 2026-07-13 |
652
653
  | `guide.work-orders-world-class-memory-compiler-tracker-uppercase` | Memory Compiler Implementation Tracker | Last reconciled: 2026-07-13 Authority: This file is the granular program tracker. The work-order documents define the contract and acceptance criteria; neither test output nor a model claim may check an item without the named evidence. |
@@ -0,0 +1,117 @@
1
+ # Preserve native Telegram answers and use compatible free inference routes
2
+
3
+ Status: implemented and verified. The user owns publication and runtime replacement.
4
+
5
+ ## Anchored incident
6
+
7
+ Telegram input 3363 (a backtick followed by “hey”), update activity
8
+ `telegram:1e8af20a7e273e82`, finalization
9
+ `telegram-64ac9937dc7647a8-1791853421483-1` ran on 1.0.846, PID 2409421,
10
+ started 2026-10-13T00:32:14.464Z. Its bundle SHA256 matches the previous
11
+ verified artifact:
12
+ `f568a8a54e037eb22f21193f7f589f8769b6b94369c0e9dfa7446ca6e8a5f87b`.
13
+ This incident is not explained by an older installed build.
14
+
15
+ Turn 0 returned ordinary assistant text: “Hey! How can I assist you today?”
16
+ The transcript and turn-1 context retain that answer. Native Telegram
17
+ disabled text completion, so the runner demanded another generation to
18
+ call task_complete. Turn 1 exhausted the remote routes and the usable
19
+ answer never acquired terminal delivery authority. The Activity panel
20
+ obscured the successful first response.
21
+
22
+ The public registry at https://robit-man.github.io/inference/ also exposed
23
+ two reproducible routing gaps: discovery lost LLM7's provider-default
24
+ selector and chose the first catalog entry, and preferred-model
25
+ incompatibility skipped a provider with other compatible models. The
26
+ catalog-less ch.at chat endpoint was excluded even from tool-free requests.
27
+ Asynchronous jobs, disabled relays, and non-chat services require distinct
28
+ adapters; their presence in the page does not establish native tool support.
29
+
30
+ ## Ordered work
31
+
32
+ 1. Admit an exact current native assistant candidate through host semantic
33
+ assessment and real effect checks. Avoid a redundant task_complete
34
+ generation. Preserve run, epoch, turn, owner, steering, candidate and
35
+ physical evidence fences, terminal receipts and the actual Telegram ACK.
36
+ No executable completion tool call may be synthesized from prose.
37
+ 2. Continue actual work when a promise lacks required mutation, observation,
38
+ verification or delivery. An unavailable auxiliary assessment may permit
39
+ delivery of current useful text under existing unavailable-review policy;
40
+ it must leave the native goal unresolved and never forge fulfillment.
41
+ 3. Preserve known selector and transport hints while merging discovered
42
+ provider capabilities. Enumerate bounded, compatible catalog alternatives
43
+ deterministically, deduplicate actual routes, preserve whole-input capacity
44
+ checks, deadlines, manual approval, Stop and provider-specific credentials.
45
+ 4. Support catalog-less ch.at only for tool-free chat using its documented
46
+ omitted-model request. Do not invent a model identifier on the wire or
47
+ advertise tools, images, or unsupported job protocols.
48
+ 5. Test ordinary native text through the actual backend/runner/bridge path,
49
+ including unavailable assessment, real missing effects, stale ownership,
50
+ cancellation and provider ACK failure. Exercise registry selector and
51
+ catalog alternative regressions without live inference or Telegram sends.
52
+ 6. Rebuild the workspaces and actual CLI artifact, verify bundle markers and
53
+ package gates, then commit and push only task-owned changes. Preserve
54
+ unrelated dirty work and user-owned release versions. The user owns npm
55
+ publication and runtime replacement.
56
+
57
+ No service restart, local model request, CUDA workload change or external
58
+ Telegram message is part of this repair's verification.
59
+
60
+ ## Result and verification
61
+
62
+ Native private and public replies now submit exact current plain text for
63
+ host review and terminal delivery custody without another completion
64
+ generation. Rejected candidates carry bounded missing-effect feedback into
65
+ the next primary request. Stop, steering reconciliation, stale candidate
66
+ rejection, ordinary prose-loop limits and actual provider acknowledgements
67
+ remain enforced. The host neither executes a synthetic task_complete nor
68
+ marks an unknown native goal fulfilled when auxiliary inference is unavailable.
69
+ Selected/generated artifacts retain their explicit delivery boundary.
70
+
71
+ The runtime merges known provider selector/auth/transport hints with page
72
+ capabilities, tries bounded compatible catalog alternatives after giving
73
+ providers their first attempt, and reads nested context/tool metadata.
74
+ Explicit non-chat, moderation and paid-only catalog entries are excluded.
75
+ ch.at's text-only route omits the model on the wire and needs no catalog;
76
+ onboarding also supports it while retaining a synthetic readiness probe.
77
+
78
+ Verification:
79
+
80
+ - 136 registry, routing and existing fallback checks passed.
81
+ - 18 host-admission/model-wire checks and 69 existing completion/steering
82
+ authority checks passed.
83
+ - 12 new actual backend/runner/Telegram bridge integration cases passed with
84
+ mocked network responses, including public topic-bound ACK, unavailable
85
+ assessment, real file mutation, review feedback, Stop and stale ownership.
86
+ - 89 existing Telegram/fallback checks, 11 header route checks and 61
87
+ onboarding checks passed. Total: 396 regression cases.
88
+ - Two live synthetic requests through the production backend succeeded:
89
+ streaming text via ch.at in 4821 ms, and streaming native function calling
90
+ via Hermes in 1764 ms. Both recorded zero local dispatches and executed no
91
+ generated action. These probes contained only synthetic public test text.
92
+ - Full workspace rebuild and staging audit passed. The tarball audit passed
93
+ with 531 files and zero warnings. Fresh isolated global npm installation
94
+ with lifecycle scripts enabled and compilers blocked passed, including
95
+ SQLite, CLI/library, companion install and PATH checks.
96
+ - All 12 mocked transport scenarios passed against the exact installed
97
+ tarball bundle. Installed and staged runtime SHA256 match:
98
+ `f5581b26f6b472a9af893e906670aabb393bc4c63944d2daeadbec245809eb01`.
99
+
100
+ Logs:
101
+ `/tmp/omnius-keyless-routing-tests-20261012.log`,
102
+ `/tmp/omnius-host-text-admission-focused.log`,
103
+ `/tmp/omnius-host-text-admission-regressions.log`,
104
+ `/tmp/omnius-native-plain-text-admission-20261012.log`,
105
+ `/tmp/omnius-plain-answer-cli-regressions-20261012.log`,
106
+ `/tmp/omnius-plain-answer-route-header-20261012.log`,
107
+ `/tmp/omnius-onboarding-catalogless-tests-20261012.log`,
108
+ `/tmp/omnius-plain-answer-live-remote-text-20261012.json`,
109
+ `/tmp/omnius-plain-answer-live-remote-tools-20261012.json`,
110
+ `/tmp/omnius-plain-answer-publish-build-final-20261012.log`,
111
+ `/tmp/omnius-plain-answer-tarball-audit-20261012.log`,
112
+ `/tmp/omnius-plain-answer-fresh-install-20261012.log` and
113
+ `/tmp/omnius-plain-answer-installed-verification-20261012.json`.
114
+
115
+ The already running 1.0.846 bot still uses the earlier f568a8a5 bundle.
116
+ The next user-owned patch publication/update and restart must load this repair;
117
+ the isolated package retained the user's staging version without publishing it.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.846",
3
+ "version": "1.0.847",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.846",
9
+ "version": "1.0.847",
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.846",
3
+ "version": "1.0.847",
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",