Repository navigation
fix(memory): forward deadline control onReadinessWait to Ollama and LM Studio embedding providers - #156434
fix(memory): forward deadline control onReadinessWait to Ollama and LM Studio embedding providers#156434Orionation wants to merge 5 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed October 7, 2026, 7:17 PM ET / 23:17 UTC (Revision 4). ClawSweeper reviewWhat this changesThe Ollama and LM Studio embedding plugins forward memory-search deadline callbacks to managed service startup so cold starts can use their separate readiness budget. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful repair: current main and the latest release still omit the readiness callback in both adapters. No introduced correctness defect was established, and the competing fix remains unmerged and conflicted, so supersession is premature. Likely related people: wangmiao0668000666 and Peter Steinberger, as routing candidates from related merged work and recent provider history. Priority: P2 Review scores
Verification
How this fits togetherMemory Core converts search queries into embedding requests through provider plugins. The plugins acquire managed local services before sending HTTP requests, and readiness callbacks tell the search deadline owner when to pause and resume. flowchart TD
A[Memory search query] --> B[Search deadline control]
B --> C[Ollama or LM Studio plugin]
C --> D[Managed service acquisition]
D --> E[Wait for readiness]
E --> B
D --> F[Embedding HTTP request]
F --> G[Vector and search results]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +66. Total +66 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Use the existing deadline-control and managed-service owners to give both query adapters the documented readiness exemption while preserving cancellation and embedding-request time limits. Do we have a high-confidence way to reproduce the issue? Yes, by source: a managed Ollama or LM Studio cold start exceeding the search budget receives no readiness callback on current main. This review did not execute a failing current-main run. Is this the best way to solve the issue? Yes, forwarding the existing callback is the narrow repair and follows the shared adapter's established pattern; the proposed head still needs direct runtime evidence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b300e0edea5e. LabelsLabel changes: No label 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 (3 earlier review cycles)
|
…M Studio embedding providers memory_search has a managed readiness budget that pauses the search deadline while a local service starts up (via onReadinessWait callbacks on the localServiceTarget). PR openclaw#143590 wired this up for the OpenAI-compatible embedding provider, but the Ollama and LM Studio adapters never forwarded the callback, so a cold-start acquisition on those providers still consumed the full search deadline. Both providers now extract MemorySearchDeadlineControl from callOptions via MEMORY_SEARCH_DEADLINE_CONTROL and pass an onReadinessWait callback into acquireLocalService, matching the existing pattern in openai-compatible-embedding-provider.ts. - Ollama: onReadinessWait forwarded from embed/embedBatch callOptions through embedMany/embedOne to the acquireLocalService call - LM Studio: onReadinessWait forwarded through withLocalServiceLease, used by both embed and embedBatch (non-query path) Query embedBatch delegates to embed and inherits its own lease per query, so no additional change is needed there. Fixes openclaw#156359
51be75d to
b5d66d6
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…o embedding provider
…mbedding provider
Local verification — real terminal output (not mocked)Environment: macOS arm64 · OpenClaw 2026.6.8 · Node v24.13.0 · vitest v5.0.1 ✅ All 16 LM Studio / Ollama memory embedding tests pass cleanThe implementation is correct. The only blocker is the reported merge conflict with |
|
Thanks @Orionation! #156483 just landed (6dd7b2e) with the same fix for #156359: the Ollama and LM Studio embedding providers now report readiness, so a cold-starting local service no longer times out memory search. It was verified on a built Gateway, so I'm closing this as superseded. Your work here helped confirm the root cause. |
What Problem This Solves
memory_searchpauses its deadline timer during managed local service startup viaonReadinessWaitcallbacks on thelocalServiceTarget. PR #143590 wired this up for the OpenAI-compatible embedding provider, but the Ollama and LM Studio adapters did not forward the callback, causing premature search cancellation on cold starts.Fix
Both providers now extract
MemorySearchDeadlineControlfromcallOptionsviaMEMORY_SEARCH_DEADLINE_CONTROLand pass anonReadinessWaitcallback intoacquireLocalService.Type fix (addressing ClawSweeper review)
The
MemoryCoreAcquireLocalServicetarget type in both adapters was missing theonReadinessWaitfield, producing an excess-property TypeScript error. Fixed by adding the optional callback to the locally-definedMemoryCoreAcquireLocalServicetarget type in both files:onReadinessWaitforwarded fromembed/embedBatchcallOptionsthroughembedMany/embedOneto theacquireLocalServicecallonReadinessWaitforwarded throughwithLocalServiceLease, used by bothembedand the non-queryembedBatchpathEvidence
onReadinessWaitintegration test coverage in the OpenAI-compatible adapter (PR fix(memory): keep managed local-service readiness on its own budget during memory_search #143590) confirms the callback correctly pauses/resumes the search deadline on local service cold startsMEMORY_SEARCH_DEADLINE_CONTROLfromcallOptions, map to(waiting: boolean) => void, and pass toacquireLocalServiceMemoryCoreAcquireLocalServicetype with the optionalonReadinessWaitfieldFixes #156359