Repository navigation
fix(lmstudio): honor embedding JIT and canonical model identity - #117320
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 2:20 PM ET / 18:20 UTC. ClawSweeper reviewWhat this changesThe PR updates LM Studio memory embeddings so disabled preload avoids eager native loading while variant model identifiers resolve to a stable canonical key before JIT embedding calls. Merge readinessKeep this PR open for the explicit maintainer decision required by its protected Priority: P2 Review scores
Verification
How this fits togetherThe LM Studio plugin converts OpenClaw provider configuration into an OpenAI-compatible local embedding client for Memory Core. It may acquire a configured local-service lease, discover LM Studio’s model catalog, optionally warm the model, then passes the chosen model key into embedding requests and memory cache identity. flowchart LR
Config[LM Studio provider config] --> Provider[Embedding provider]
Provider --> Policy[Preload policy]
Catalog[LM Studio model catalog] --> Identity[Canonical model key]
Policy --> Identity
Identity --> Client[Embedding client]
Client --> Memory[Memory embeddings and cache]
Decision needed
Why: The patch is a focused repair with sufficient proof, but the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +53, Tests +172. Total +225 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the plugin-local repair, merge after exact-head CI and a maintainer compatibility check, and preserve the canonical key as the single identity used by preload-enabled warmup, preload-disabled JIT requests, and memory caching. Do we have a high-confidence way to reproduce the issue? Yes: current main unconditionally invokes LM Studio native warmup during embedding-provider creation, while the current-head tests directly exercise Is this the best way to solve the issue? Yes: this is the best fix because vendor-specific catalog and model-key semantics remain in the LM Studio plugin, reuse existing catalog and canonical-key helpers, and avoid adding a new core configuration or compatibility layer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 21a767639fa0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
0fdf7b0 to
7c3f8b0
Compare
|
@clawsweeper re-review Repaired head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer decision: accepted. The canonical-key cache identity change is intentional: LM Studio variant identifiers are request selections, while the resolved canonical model key is the stable provider, wire, and cache identity. This avoids cache fragmentation and keeps preload-enabled and JIT paths consistent. Exact repaired head |
|
GitHub's merge API rejected I am direct-landing a normal merge commit onto |
…claw#117320) * codex/qa400-lmstudio-jit-canonical-identity: fix(lmstudio): resolve JIT embedding variants fix(lmstudio): preserve embedding preload and model identity
What Problem This Solves
Fixes an issue where LM Studio memory embeddings ignored
models.providers.<provider>.params.preload: false, eagerly loaded a model during providercreation, and sent unusable
@variantidentifiers to LM Studio when JIT loading was enabled.Why This Change Was Made
Embedding setup now follows the provider-owned preload policy already used by chat. Canonical model
IDs skip native discovery and loading entirely when preload is disabled. Variant IDs perform only a
catalog lookup so provider, cache, and wire identity are stable before memory snapshots them; the
actual model load remains owned by LM Studio JIT on the first embedding request.
Preload-enabled setups still warm the model and retain the canonical ID returned by native
discovery, including when the subsequent load fails.
User Impact
Operators can use LM Studio JIT, idle TTL, and auto-eviction for memory embeddings without OpenClaw
eagerly loading weights. Quantized variant configurations now use the canonical LM Studio wire ID
while keeping provider and memory-cache identity consistent. Configured local-service leases remain
balanced for discovery, warmup, and embedding requests.
Evidence
7c3f8b0a286f4f; rebased ontoa67c52611e5768.node scripts/run-vitest.mjs extensions/lmstudio/src/embedding-provider.test.ts- 17 passed.node scripts/run-vitest.mjs extensions/lmstudio/src/models.test.ts extensions/lmstudio/src/stream.test.tsoxfmt --check extensions/lmstudio/src/embedding-provider.ts extensions/lmstudio/src/embedding-provider.test.tsand
git diff --checkpassed.packages/terminal-core/src/ansi.ts(194,38): TS2554; all LM Studio branch type errors found duringrepair were corrected.
return a verdict within its 32-minute window, so this is recorded as unavailable rather than
passed.
Live LM Studio proof
Tested against LM Studio
0.4.20+1with no Ollama model loaded.This proves LM Studio advertises the variant but requires its canonical key on the native load
route. The preload-disabled variant regression verifies that OpenClaw performs catalog discovery
without calling the native load helper, freezes the canonical provider/cache identity, and sends
that same canonical ID through the embedding transport.
LM Studio JIT was also exercised from a fully unloaded state:
Hosted exact-head CI is required before merge.