LearnNewsExamplesServices
Frontmatter
titlefix(ai): bound LMS REM graph output (#13981)
authorneo-gpt
stateClosed
createdAtJun 25, 2026, 3:08 AM
updatedAtJul 27, 2026, 12:07 AM
closedAtJun 25, 2026, 3:30 AM
mergedAt
branchesdevcodex/13981-lms-rem-output-cap
urlhttps://github.com/neomjs/neo/pull/13982
contentTrust
projected
quarantined0
signals[]
Closed
neo-gpt
neo-gpt commented on Jun 25, 2026, 3:08 AM

Resolves #13981

Bounds REM graph structured-output generation for LMS/OpenAI-compatible chat calls so turn-boundary input chunking is not undermined by unbounded JSON output. The patch adds an ADR-19 AiConfig.localModels.chat.graphOutputLimitTokens leaf, applies it to Tri-Vector and topology graph extraction calls via max_tokens, preserves LMS streaming finish_reason metadata when present, and logs chunk-start details before each Tri-Vector provider call.

Evidence: L2 unit/static validation covers #13981 AC1-AC5. Residual: post-merge live REM backlog drain should confirm LMS no longer grows past the bounded chunk/output contract on the active backlog.

Deltas from ticket

  • Used max_tokens only for LMS/OpenAI-compatible payload compatibility; no wall-clock timeout was added.
  • Kept provider envelope compatibility: finish_reason fields are only added when LMS sends finish metadata.
  • Applied the same graph output cap to topology inference because it is the second REM graph-provider call path.

Test Evidence

  • node --check ai/config.template.mjs
  • node --check ai/provider/OpenAiCompatible.mjs
  • node --check ai/services/graph/TopologyInferenceEngine.mjs
  • git diff --check
  • npm run test-unit -- test/playwright/unit/ai/provider/KeepAlive.spec.mjs — 22 passed, 1 skipped
  • npm run test-unit -- test/playwright/unit/ai/services/graph/SemanticGraphExtractor.spec.mjs — 12 passed
  • npm run test-unit -- test/playwright/unit/ai/config.template.spec.mjs — 8 passed
  • npm run agent-preflight -- ai/config.template.mjs ai/provider/OpenAiCompatible.mjs ai/services/graph/SemanticGraphExtractor.mjs ai/services/graph/TopologyInferenceEngine.mjs test/playwright/unit/ai/config.template.spec.mjs test/playwright/unit/ai/provider/KeepAlive.spec.mjs test/playwright/unit/ai/services/graph/SemanticGraphExtractor.spec.mjs

Post-Merge Validation

  • Pull dev, run the config overlay update script, restart the orchestrator, and confirm the pending REM backlog resumes with LMS chunk logs and without over-cap growth.

Commit

  • 079858ee28fix(ai): bound LMS REM graph output (#13981)

Authored by Euclid (GPT-5, Codex Desktop). Session 019ef378-527d-7393-bc74-ec3a1d3f2ddf.

tobiu
tobiu commented on Jun 25, 2026, 3:30 AM

REJECTED. this does not help. and 8k tokens is WAY too low.