omnius 1.0.693 → 1.0.694

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
@@ -662702,6 +662702,15 @@ function classifyThinkOutcome(raw) {
662702
662702
  }
662703
662703
  return null;
662704
662704
  }
662705
+ function logicalRequestVariantId(logicalRequestId, variant) {
662706
+ return `ollama:${variant}:${_createHash("sha256").update(`${logicalRequestId}\0${variant}`).digest("hex").slice(0, 24)}`;
662707
+ }
662708
+ function withLogicalRequestVariant(request, variant) {
662709
+ return request.logicalRequestId ? {
662710
+ ...request,
662711
+ logicalRequestId: logicalRequestVariantId(request.logicalRequestId, variant)
662712
+ } : request;
662713
+ }
662705
662714
  var PRESERVE_MODEL_VISIBLE_HISTORY, TOOL_SUBSETS, TOOL_AUTO_DEMOTE_TURNS, LEGACY_ACTION_REASON_KEYS, CLAIM_TASK_STOPWORDS, TASK_COMPLETE_CLOSEOUT_DESCRIPTION, SYSTEM_PROMPT_COMMON, SYSTEM_PROMPT, SYSTEM_PROMPT_MEDIUM, SYSTEM_PROMPT_SMALL, VISUAL_TOOLS, AUDIO_TOOLS, SOCIAL_TOOLS, SPATIAL_TOOLS, CODE_TOOLS, AgenticRunner, BROKER_QUEUE_DEADLINE_ERROR, InferenceHttpError, OllamaAgenticBackend;
662706
662715
  var init_agenticRunner = __esm({
662707
662716
  "packages/orchestrator/dist/agenticRunner.js"() {
@@ -692604,7 +692613,8 @@ arguments=` : ""}` + (chunk.toolCallArgs ?? "");
692604
692613
  const shouldRetryThinkGuard = outcome !== null && effectiveThink === true && (justSuppressed || outcome === "empty_after_strip" || outcome === "unclosed_think");
692605
692614
  if (shouldProbeNativeOnEmpty) {
692606
692615
  try {
692607
- const _native = await this.nativeOllamaChatCompletion(request, {
692616
+ const nativeRecoveryRequest = withLogicalRequestVariant(request, "native-empty-recovery");
692617
+ const _native = await this.nativeOllamaChatCompletion(nativeRecoveryRequest, {
692608
692618
  // Keep recovery on the pool endpoint that already admitted and
692609
692619
  // warmed this request. Falling back to the broker/base URL can
692610
692620
  // cold-load a second copy of a large model while the admitted
@@ -692647,13 +692657,8 @@ arguments=` : ""}` + (chunk.toolCallArgs ?? "");
692647
692657
  retryBody["num_ctx"] = reqNumCtx;
692648
692658
  }
692649
692659
  try {
692650
- const retryOpts = {
692651
- method: "POST",
692652
- headers: this.authHeaders(request),
692653
- body: JSON.stringify(retryBody)
692654
- };
692655
- if (combinedAbortSignal)
692656
- retryOpts.signal = combinedAbortSignal;
692660
+ const openAiRetryRequest = withLogicalRequestVariant(request, "openai-empty-retry");
692661
+ const retryOpts = this.brokerRequestOptions(openAiRetryRequest, retryBody, combinedAbortSignal);
692657
692662
  const retryResp = await fetch(this.providerRequestUrl(requestBaseUrl, "chat"), retryOpts);
692658
692663
  if (retryResp.ok) {
692659
692664
  const retryData = await retryResp.json();
@@ -801757,6 +801762,9 @@ function telegramStreamFailureAllowsUnaryFallback(err) {
801757
801762
  text3
801758
801763
  );
801759
801764
  }
801765
+ function telegramUnaryCompatibilityLogicalRequestId(streamLogicalRequestId) {
801766
+ return `telegram:unary-compat:${createHash91("sha256").update(streamLogicalRequestId).digest("hex").slice(0, 24)}`;
801767
+ }
801760
801768
  function telegramRouterErrorText(err) {
801761
801769
  return err instanceof Error ? err.message : String(err);
801762
801770
  }
@@ -811130,7 +811138,14 @@ ${JSON.stringify(modelFollowupProposals, null, 2)}`,
811130
811138
  ],
811131
811139
  tools: [],
811132
811140
  temperature: 0.2,
811133
- maxTokens: 300,
811141
+ // The contract permits up to 700 characters of message text plus
811142
+ // evidence IDs and decision metadata. A 300-token ceiling can end
811143
+ // at `finish=length` before a complete JSON object exists.
811144
+ maxTokens: 1024,
811145
+ // Ollama's OpenAI-compatible renderer can spend the full token
811146
+ // budget in hidden reasoning even with think:false. Native chat
811147
+ // enforces direct-answer mode and avoids an empty-stream fallback.
811148
+ preferNativeOllamaChat: this.agentConfig.backendType === "ollama",
811134
811149
  timeoutMs: Math.min(
811135
811150
  Math.max(this.agentConfig.timeoutMs ?? 3e4, 5e3),
811136
811151
  2e4
@@ -813819,7 +813834,15 @@ ${this.quoteTelegramContextBlock(msg.text, 1200)}`
813819
813834
  id2,
813820
813835
  `stream protocol did not return a usable contract; using one unary compatibility request: ${streamErr instanceof Error ? streamErr.message : String(streamErr)}`
813821
813836
  );
813822
- result = await backend.chatCompletion(requestWithCtx);
813837
+ const unaryCompatibilityRequest = {
813838
+ ...requestWithCtx,
813839
+ logicalRequestId: telegramUnaryCompatibilityLogicalRequestId(
813840
+ logicalRequestId
813841
+ )
813842
+ };
813843
+ result = await backend.chatCompletion(
813844
+ unaryCompatibilityRequest
813845
+ );
813823
813846
  this.updateTelegramInferenceFinal(id2, result);
813824
813847
  this.tuiWrite(
813825
813848
  () => renderTelegramSubAgentEvent(
@@ -32842,7 +32842,7 @@
32842
32842
  "id": "guide.work-orders-runtime-health-remediation-tracker-uppercase",
32843
32843
  "kind": "guide",
32844
32844
  "title": "Runtime Health Remediation Master Tracker",
32845
- "summary": "Authority: canonical granular tracker for RHR-2026-09-02 Checked-item rule: code, focused tests, and named evidence must all exist Last reconciled: 2026-09-02",
32845
+ "summary": "Authority: canonical granular tracker for RHR-2026-09-02 Checked-item rule: code, focused tests, and named evidence must all exist Last reconciled: 2026-09-04",
32846
32846
  "keywords": [
32847
32847
  "work",
32848
32848
  "orders",
@@ -33942,6 +33942,46 @@
33942
33942
  }
33943
33943
  ]
33944
33944
  },
33945
+ {
33946
+ "id": "guide.work-orders-runtime-health-remediation-wo-24-telegram-logical-request-variant-identity-uppercase",
33947
+ "kind": "guide",
33948
+ "title": "WO-24: Telegram logical request variant identity",
33949
+ "summary": "Telegram follow-up requests could finish a streamed inference with no visible contract and then fail their one unary compatibility request with HTTP 409: logicalrequestconflict. The observed stream used all 300 completion tokens and ended with finish=length.",
33950
+ "keywords": [
33951
+ "work",
33952
+ "orders",
33953
+ "runtime",
33954
+ "health",
33955
+ "remediation",
33956
+ "WO",
33957
+ "24",
33958
+ "telegram",
33959
+ "logical",
33960
+ "request",
33961
+ "variant",
33962
+ "identity",
33963
+ "md"
33964
+ ],
33965
+ "maturity": "internal",
33966
+ "audiences": [
33967
+ "maintainer",
33968
+ "large-context-agent"
33969
+ ],
33970
+ "layer": "documentation",
33971
+ "interfaces": [
33972
+ {
33973
+ "type": "file",
33974
+ "target": "docs/work-orders/runtime-health-remediation/WO-24-telegram-logical-request-variant-identity.md"
33975
+ }
33976
+ ],
33977
+ "references": [
33978
+ {
33979
+ "type": "documentation",
33980
+ "target": "docs/work-orders/runtime-health-remediation/WO-24-telegram-logical-request-variant-identity.md",
33981
+ "relation": "canonical-artifact"
33982
+ }
33983
+ ]
33984
+ },
33945
33985
  {
33946
33986
  "id": "guide.work-orders-telegram-dmn-wo-22-dmn-outreach-and-learning-uppercase",
33947
33987
  "kind": "guide",
package/docs/DISCOVERY.md CHANGED
@@ -533,7 +533,7 @@ Daemon equivalents are `GET /v1/discovery/bootstrap`, `GET /v1/discovery?q=<inte
533
533
  | `guide.work-orders-runtime-health-remediation-live-telegram-log-review-2026-09-03-uppercase` | Live Telegram Log Review, 2026-09-03 | This review is read-only. It examines the persisted Telegram conversation and intake lifecycle records in /home/roko/Documents/Projects/Adjacent/telegramtest/.omnius. The running global Omnius package reports version 1.0.687. This means the observations describe the deployed pre-publication runtime, not the newer source commits on this repository's main bran |
534
534
  | `guide.work-orders-runtime-health-remediation-readme-uppercase` | Runtime Health Remediation Program | Program ID: RHR-2026-09-02 Status: active, implementation authorized Owner: Omnius runtime, orchestration, execution, memory, and Telegram packages External dependency: /home/roko/Desktop/ollama-unify Last reconciled: 2026-09-03 |
535
535
  | `guide.work-orders-runtime-health-remediation-traceability-uppercase` | Runtime Health Remediation Traceability Matrix | Every completed row links to a deterministic test or operational receipt. A commit hash alone is not proof. A model statement is not proof. Live logs may support a canary only after the hermetic and deterministic gates pass. A status that names pending rollout or live work is intentionally not a completion claim. |
536
- | `guide.work-orders-runtime-health-remediation-tracker-uppercase` | Runtime Health Remediation Master Tracker | Authority: canonical granular tracker for RHR-2026-09-02 Checked-item rule: code, focused tests, and named evidence must all exist Last reconciled: 2026-09-02 |
536
+ | `guide.work-orders-runtime-health-remediation-tracker-uppercase` | Runtime Health Remediation Master Tracker | Authority: canonical granular tracker for RHR-2026-09-02 Checked-item rule: code, focused tests, and named evidence must all exist Last reconciled: 2026-09-04 |
537
537
  | `guide.work-orders-runtime-health-remediation-wo-00-hermetic-test-boundary-uppercase` | WO-00: Hermetic Test Boundary | Status: deterministic acceptance complete Evidence: inference network inventory and audit receipt for commit 8708e449 Risk: high, because current unit tests can contact the live broker Depends on: none |
538
538
  | `guide.work-orders-runtime-health-remediation-wo-00-inference-network-inventory-uppercase` | WO-00 Inference Network Inventory | This document describes the machine-checked boundary for production inference clients. The canonical inventory is test-support/inference-network-registry.ts. |
539
539
  | `guide.work-orders-runtime-health-remediation-wo-01-inference-pressure-scheduler-uppercase` | WO-01: Foreground and Background Inference Pressure Scheduler | Status: deterministic acceptance complete Evidence: production Telegram cognition integration and controlled-load foreground exclusion Risk: critical, because background work currently competes with user work Depends on: WO-00 |
@@ -562,6 +562,7 @@ Daemon equivalents are `GET /v1/discovery/bootstrap`, `GET /v1/discovery?q=<inte
562
562
  | `guide.work-orders-runtime-health-remediation-wo-21-task-convergence-and-todo-scope-uppercase` | WO-21: Task convergence and todo scope | On 2026-09-03, a user reported that Omnius remained at task 2/8 for about 40 turns. The report did not include a screenshot or run artifact, so the exact label remains unverified. Omnius has two similar counters: |
563
563
  | `guide.work-orders-runtime-health-remediation-wo-22-autocomplete-footer-geometry-uppercase` | WO-22: Autocomplete Footer Geometry Integrity | Scope: CLI TUI footer, DirectInput redraw scheduling, active content writes |
564
564
  | `guide.work-orders-runtime-health-remediation-wo-23-long-horizon-control-plane-reconciliation-uppercase` | WO-23: Long-horizon control-plane reconciliation | The restored telegramtest run tui-3869250-mtlvp324-1788468819792-1 continued a large pentest-tooling frontend task across a process restart. It made real source mutations and advanced from the first implementation group to todo-p2a. The run was not dead and its model context had ample nominal capacity. |
565
+ | `guide.work-orders-runtime-health-remediation-wo-24-telegram-logical-request-variant-identity-uppercase` | WO-24: Telegram logical request variant identity | Telegram follow-up requests could finish a streamed inference with no visible contract and then fail their one unary compatibility request with HTTP 409: logicalrequestconflict. The observed stream used all 300 completion tokens and ended with finish=length. |
565
566
  | `guide.work-orders-telegram-dmn-wo-22-dmn-outreach-and-learning-uppercase` | WO-22: DMN outreach, DM sharing, and outcome learning | On 2026-09-03 at 17:07 PDT the bot posted in the OMNIUS group without being addressed. The operator asked whether this was self-induced reflection. |
566
567
  | `guide.work-orders-telegram-dropbear-context-rca-workorder` | Telegram Dropbear Context Engineering RCA Work Order | Observed run: /home/roko/Documents/Projects/Adjacent/telegramtest/.omnius, run id 1782873796963-i5r7mv. |
567
568
  | `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 |
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Authority:** canonical granular tracker for RHR-2026-09-02
4
4
  **Checked-item rule:** code, focused tests, and named evidence must all exist
5
- **Last reconciled:** 2026-09-02
5
+ **Last reconciled:** 2026-09-04
6
6
 
7
7
  ## Phase 0: durable program boundary
8
8
 
@@ -271,6 +271,23 @@ deterministically repaired P0 or P1 defect.
271
271
  workspace build.
272
272
  - [x] Commit and push the scoped repair to `main`.
273
273
 
274
+ ## WO-24: Telegram logical request variant identity
275
+
276
+ - [x] Correlate empty Telegram streams with broker conflict receipts.
277
+ - [x] Confirm the broker correctly binds one logical ID to one exact wire
278
+ contract.
279
+ - [x] Give stream-to-unary compatibility fallback a distinct stable ID.
280
+ - [x] Give `/v1`-to-native empty recovery a distinct stable ID.
281
+ - [x] Give changed `/v1` recovery bodies a distinct stable ID.
282
+ - [x] Preserve the original ID across byte-identical queue retries.
283
+ - [x] Route Ollama follow-up decisions through native chat with `think:false`.
284
+ - [x] Raise the follow-up contract budget from 300 to 1,024 tokens.
285
+ - [x] Add a broker-faithful 409 conflict regression harness.
286
+ - [x] Pass backend, Telegram transport, observability, and Bot API suites.
287
+ - [x] Pass affected package typechecks and the workspace build.
288
+ - [ ] Run a token-generating live canary only after the mandatory accelerator
289
+ preflight identifies the requested endpoint, model, and GPU placement.
290
+
274
291
  ## Program completion gate
275
292
 
276
293
  - [x] All repository-controlled deterministic WO acceptance sections pass.
@@ -0,0 +1,65 @@
1
+ # WO-24: Telegram logical request variant identity
2
+
3
+ ## Incident
4
+
5
+ Telegram follow-up requests could finish a streamed inference with no visible
6
+ contract and then fail their one unary compatibility request with HTTP 409:
7
+ `logical_request_conflict`. The observed stream used all 300 completion tokens
8
+ and ended with `finish=length`.
9
+
10
+ The broker response was correct. Omnius reused one logical request ID after it
11
+ changed the request body from streaming to unary. The same contract violation
12
+ also existed in the backend's empty-output recovery path when it changed from
13
+ OpenAI-compatible `/v1/chat/completions` to native `/api/chat`, or when it
14
+ constructed a changed `/v1` retry body.
15
+
16
+ ## Root cause
17
+
18
+ ollama-unify binds a logical request ID to the exact request method, path,
19
+ content type, and body. It uses that binding for idempotent queue admission and
20
+ completed-response replay. Omnius treated the ID as a broad correlation ID.
21
+ It therefore reused the ID across different transport contracts. The broker
22
+ rejected the second contract instead of replaying an unrelated response.
23
+
24
+ The initial empty output had a second cause. Telegram follow-up inference used
25
+ the OpenAI-compatible Ollama renderer without native transport preference. A
26
+ Qwen-derived model can consume its entire budget in renderer-managed reasoning
27
+ even when the caller requests `think:false`. The stream adapter then has no
28
+ visible contract to parse.
29
+
30
+ ## Invariants
31
+
32
+ - [x] One logical request ID identifies one exact wire contract.
33
+ - [x] Byte-identical queue retries retain their original ID.
34
+ - [x] A stream-to-unary transition derives a new stable ID.
35
+ - [x] A `/v1`-to-native recovery transition derives a new stable ID.
36
+ - [x] A changed retry body derives a new stable ID.
37
+ - [x] A Telegram Ollama follow-up uses native chat and explicit
38
+ direct-answer mode.
39
+ - [x] Follow-up output capacity fits the declared JSON contract.
40
+ - [x] A deterministic test broker rejects any future cross-contract ID reuse.
41
+
42
+ ## Implementation
43
+
44
+ - [x] Add `telegramUnaryCompatibilityLogicalRequestId`.
45
+ - [x] Apply the derived ID to the unary compatibility request only.
46
+ - [x] Add backend request-variant identity derivation.
47
+ - [x] Apply a native-recovery identity before `/api/chat`.
48
+ - [x] Apply a changed-retry identity before the second `/v1` request.
49
+ - [x] Use the normal broker request builder for the changed retry.
50
+ - [x] Set `preferNativeOllamaChat` for Ollama follow-up decisions.
51
+ - [x] Raise follow-up `maxTokens` from 300 to 1,024.
52
+ - [x] Document logical ID semantics on the backend request contract.
53
+
54
+ ## Verification
55
+
56
+ - `pnpm --filter @omnius/orchestrator typecheck`: passed.
57
+ - `pnpm --filter omnius typecheck`: passed.
58
+ - `ollama-backend-pool.test.ts`: 27 tests passed.
59
+ - `telegram-inference-contract.test.ts`: 10 tests passed.
60
+ - `telegram-observability.test.ts`: 22 tests passed.
61
+ - `telegram-bot-api-10.test.ts`: 135 tests passed.
62
+ - The mocked broker stores the first exact body for every logical ID and emits
63
+ the production-style non-retryable 409 response if later content differs.
64
+ - No token-generating live inference was used. A live canary remains subject to
65
+ the mandatory endpoint, model, and physical GPU placement preflight.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.693",
3
+ "version": "1.0.694",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "omnius",
9
- "version": "1.0.693",
9
+ "version": "1.0.694",
10
10
  "bundleDependencies": [
11
11
  "image-to-ascii"
12
12
  ],
@@ -4354,9 +4354,9 @@
4354
4354
  }
4355
4355
  },
4356
4356
  "node_modules/hono": {
4357
- "version": "4.13.5",
4358
- "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.5.tgz",
4359
- "integrity": "sha512-O6+/eCYRkzzzy0rPWwKLiGBR1nFuUPZynnwjxN1MBA62NNqbT0wQEzQyK2gSO5yDIDB336sXQleAhOHrzlYyKw==",
4357
+ "version": "4.13.7",
4358
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.7.tgz",
4359
+ "integrity": "sha512-c8/gF9ac8Y78/agExVocyLevgR+JlpNB444Py0FSX8pJoPdYUfUzRcXtYEYGwt6l19qIlVZPN5Mfsw9jFShmQQ==",
4360
4360
  "license": "MIT",
4361
4361
  "engines": {
4362
4362
  "node": ">=16.9.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnius",
3
- "version": "1.0.693",
3
+ "version": "1.0.694",
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",