LearnNewsExamplesServices
Frontmatter
titlefix(ai): replace stale lms resident models (#13700)
authorneo-gpt
stateMerged
createdAtJun 24, 2026, 10:37 AM
updatedAtJun 24, 2026, 11:43 AM
closedAtJun 24, 2026, 11:43 AM
mergedAtJun 24, 2026, 11:43 AM
branchesdevcodex/13700-lms-preload-replace
urlhttps://github.com/neomjs/neo/pull/13941
contentTrust
projected
quarantined0
signals[]
Merged
neo-gpt
neo-gpt commented on Jun 24, 2026, 10:37 AM

Resolves #13700 Related: #13942

Reworks LM Studio preload from blind resident reload to shape-aware replacement. ensureLmsModelsLoaded now uses lms ps --json metadata when a resident model has context/parallel gates, skips exact identifiers that already match the configured shape, unloads a stale exact identifier before reloading it with stable --identifier <model>, and unloads suffixed siblings only after the exact configured id is verified sufficient.

Scope Boundary

This PR is the local LM Studio / OpenAI-compatible adapter fix for #13700. It does not claim to solve cloud/native Ollama deployment recovery. Active-provider residency recovery belongs to the diagnostics -> recovery daemon path under ADR-0025/ADR-0026 and is tracked in #13942.

Evidence: L2 (mocked lms load / lms unload dispatch plus focused provider-readiness unit coverage) -> L3 required (live LM Studio host shows only exact configured ids after orchestrator preload). Residual: live post-merge lms ps validation [#13700].

Deltas from ticket

  • Extends the original chat --parallel ticket into the unresolved load-order / already-loaded replacement path identified in the latest issue comment.
  • Keeps phase-2 idle downscaling out of this PR; Discussion #13873 already owns that proactive homeostatic loop.
  • Keeps cloud/native-provider recovery out of this PR; #13942 owns the active-provider daemon recovery lane.
  • Does not add or change AiConfig leaves; callers still pass resolved context/parallel maps into the helper.

Test Evidence

  • npm run agent-preflight -- ai/services/graph/providerReadinessHelper.mjs test/playwright/unit/ai/scripts/runners/runSandman.spec.mjs
  • npm run test-unit -- test/playwright/unit/ai/scripts/runners/runSandman.spec.mjs -> 52 passed
  • git diff --check

Post-Merge Validation

  • Restart the orchestrator / LM Studio preload path on the local host.
  • Run lms ps or lms ps --json and verify the configured chat and embedding models have the exact configured identifiers with the expected context/parallel shape.
  • Verify stale suffixed resident siblings such as <model>:2 / <model>:3 are not left loaded after preload succeeds.

Commit

  • 7685fcd7f7 - fix(ai): replace stale lms resident models (#13700)

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

tobiu
tobiu APPROVED reviewed on Jun 24, 2026, 11:43 AM

No review body provided.