Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
memory_search's readiness-budget fix added onReadinessWait to ProviderLocalServiceTarget, but only the OpenAI-compatible embedding provider sets it; the bundled Ollama and LM Studio embedding providers build their target without it, so a managed cold-start on those providers still consumes the whole search deadline.
Steps to reproduce
- Configure a managed local service for an Ollama or LM Studio embedding provider, e.g.
models.providers.<id>.localServicewith a cold start near or exceeding thememory_searchbudget. - Run
memory_search. - The service-acquisition wait is not paused, so the search deadline fires mid-startup and aborts the search.
By inspection this is the exact symptom #143590 set out to fix; the same configuration on an openai-completions provider survives because that provider does report the wait.
Expected behavior
docs/gateway/local-model-services.md states the behavior generically:
During
memory_search, managed embedding startup usesreadyTimeoutMsinstead of the search and query-embedding timeouts. Those timers resume after the service is ready.
The same page names all three adapters when describing the feature (line 24: "Ollama, LM Studio, or OpenAI-compatible adapter"). llama-cpp is covered because it delegates to the OpenAI-compatible generic adapter.
Actual behavior
onReadinessWait is assigned in exactly one production file. git grep onReadinessWait over the tree yields the type (src/agents/provider-local-service-target.ts:13), the owner (src/agents/provider-local-service.ts:175,226), the one assignment (src/plugins/openai-compatible-embedding-provider.ts:352), and tests.
Neither bundled provider sets it:
- Ollama —
extensions/ollama/src/embedding-provider.runtime.ts:399-404buildslocalServiceTargetas{ providerId, baseUrl, headers }and callsclient.acquireLocalService(client.localServiceTarget, signal)at line 415 with noonReadinessWaitkey. - LM Studio —
extensions/lmstudio/src/embedding-provider.ts:242-248buildslocalServiceTargetas{ providerId, baseUrl, headers }and callsacquireLocalService(localServiceTarget, signal)at line 257, likewise without the key.
The owner brackets the entire cold-start wait with the hook (src/agents/provider-local-service.ts:175 / 226):
target.onReadinessWait?.(true);
try {
...
healthy ? await probeHealth(...) : false;
...
managed.starting = startAndWaitForLocalService({...});
await waitForAbort(managed.starting, signal);
...
} finally {
target.onReadinessWait?.(false);
}The property is optional on the target type (provider-local-service-target.ts:13, documented as "Reports readiness waits only; reconciliation and request work stay outside"), so omitting it is type-valid and the ?. call degrades to a silent no-op. Construction of the target literals in both providers is not type-checked against the full key set.
Logs
NOT_ENOUGH_INFO — I verified this by source inspection and did not run a live cold-start Ollama or LM Studio managed service.
Screenshots, recordings, and evidence
Not applicable to the wiring gap itself. The relevant test coverage does not reach it:
src/plugins/openai-compatible-embedding-provider.test.tsasserts the provider forwards the callback, using a mock acquirer hard-coded to invoketarget.onReadinessWait?.(true/false).src/agents/provider-local-service.readiness.test.tsconstructs a target with the callback already attached — it verifies the acquire side, not that each provider wires it.
No test in extensions/ollama or extensions/lmstudio references onReadinessWait, and #143590 touched no file in either extension.
Impact and severity
Affected: deployments using a managed local service with the Ollama or LM Studio embedding provider and running memory_search across a cold start.
Severity: Moderate — memory_search fails where the documented readiness budget should have covered it.
Frequency: Intermittent; only when service startup approaches or exceeds the search budget. A warm service is unaffected.
Consequence: memory search aborts during cold start instead of waiting out readyTimeoutMs.
Additional information
Not a regression from #143590 — before it, no provider paused at all. This is an incompleteness in that change: the fix landed on the one adapter that happens to be shared by llama-cpp, leaving the two dedicated provider extensions on the old behavior while the docs describe the new one generically.
The repair mirrors the existing assignment: set onReadinessWait when building localServiceTarget in both providers, forwarding to the same deadline control the OpenAI-compatible adapter uses. Coverage should assert the wiring per provider rather than only that the acquire owner invokes a pre-attached callback.
Disclosure: I authored #143590. I filed this as an issue rather than a PR because proving it end-to-end needs a live cold-start Ollama or LM Studio managed service, which I have not run, and I would rather not put a patch behind an unproven reachability claim.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Sep 23, 2026
Codex review: this still needs some work. Reviewed September 28, 2026, 9:26 AM ET / 13:26 UTC.
Summary
Current
mainstill has the reported readiness-wait gap. The reporter’s follow-up provides a controlled failure and comparison, and two open PRs propose fixes; neither has merged.Reproducibility: yes. by source inspection: both provider entry paths omit a callback that the deadline owner invokes only when present. The reporter also supplied a controlled failure and comparison; this review did not run a current-main cold start.
Root-cause cluster
Relationship:
canonicalCanonical: #156359
Summary: This issue identifies the remaining provider-wiring gap; two open PRs propose fixes, while the earlier merged change established the shared readiness mechanism.
Members:
fixed_by_candidate: fix(memory): forward deadline control onReadinessWait to Ollama and LM Studio embedding providers #156434 - Open PR explicitly proposes callback forwarding for both named providers.fixed_by_candidate: fix(memory): report managed local-service readiness from the Ollama and LM Studio embedding providers #156483 - Open PR explicitly proposes the same repair and reports real managed-child proof.partial_overlap: fix(memory): keep managed local-service readiness on its own budget during memory_search #143590 - Merged the generic readiness-budget mechanism but did not wire the two dedicated adapters.superseded: fix(embeddings): pause search deadline during local readiness #156909 - This alternative fix PR closed without merging while the two narrower candidates remain open.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
Two open PRs already claim this fix; review and reconcile those candidates rather than dispatching a third implementation.
Review details
Best possible solution:
Land one focused provider-wiring fix with coverage for both adapters and their unchanged non-managed paths, preserving the reported cold-start proof.
Do we have a high-confidence way to reproduce the issue?
Yes, by source inspection: both provider entry paths omit a callback that the deadline owner invokes only when present. The reporter also supplied a controlled failure and comparison; this review did not run a current-main cold start.
Is this the best way to solve the issue?
Yes. Forwarding the existing per-call deadline control through each provider’s service-acquisition target is narrower than adding another timer or policy owner.
AGENTS.md: found and applied where relevant.
Codex review notes: model internal, reasoning medium; reviewed against b27c79ba1562.
Label changes
Label changes:
clawsweeper:linked-pr-open: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.clawsweeper:queueable-fix: Current issue advisory state no longer selects this label.Label justifications:
P2: A managed local embedding cold start can abort memory search, but warm services and other provider paths are unaffected.impact:session-state: The failure suppresses semantic memory retrieval during affected searches.Evidence reviewed
What I checked:
extensions/ollama/src/embedding-provider.runtime.ts:372, b27c79ba1562)extensions/lmstudio/src/embedding-provider.ts:233, b27c79ba1562)src/agents/provider-local-service.ts:172, b27c79ba1562)docs/gateway/local-model-services.md. (docs/gateway/local-model-services.md:83, b27c79ba1562)Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.clawsweeper commentedon Sep 23, 2026
🦞⚠️
Automatic implementation stopped before completion.
Reason: The automatic implementation worker stopped before all deterministic gates completed. Open the workflow run for the exact blocker.
Worker: https://github.com/openclaw/clawsweeper/actions/runs/35846347914
Automatic implementation progress:
clawsweeper:manual-onlyorclawsweeper:human-review.wangmiao0668000666 commentedon Sep 23, 2026
Adding real behavior proof, which the initial report lacked.
What was proven
Both bundled providers were driven through the real deadline-control mechanism (
createMemorySearchDeadlineControl) with a real slow managed-service acquire (300 ms) against a 150 ms search budget, using the providers' own realembed()entry points. Same harness, same timings; only the provider differs.Ollama (
extensions/ollama/src/embedding-provider.runtime.ts):No pause was reported at all — the budget ran its full 150 ms and expired while the provider was still waiting for readiness.
Control — shared OpenAI-compatible provider (
src/plugins/openai-compatible-embedding-provider.ts), which does wire the callback:The pause at 0 ms and resume at 303 ms bracket the acquire exactly, and the budget survived the 300 ms wait despite being only 150 ms.
baseUrl, headers, providerIdbaseUrl, headers, **onReadinessWait**, providerIdThe only difference between the two runs is the provider, so the outcome is attributable to the missing callback rather than to the measurement harness.
Harness note
The budget replica mirrors the owner's watchdog in
extensions/memory-core/src/memory/manager-embedding-ops.ts:218-236, including its documented rule that a phase starting after the budget is already consumed gets no exemption. An earlier version of this harness armed the budget at construction time, which measured module-load latency instead of the operation and produced a false negative for both providers; arming immediately beforeembed()is what makes the control pass and the contrast meaningful.Still not proven
No live cold-start Ollama or LM Studio managed service was run; the acquire hook is a real-shaped stub rather than a real child process. The claim being proven is narrower and exact: the Ollama and LM Studio providers never set
onReadinessWait, so the owner'starget.onReadinessWait?.(...)is a no-op for them, while it fires for the shared provider.extensions/lmstudio/src/embedding-provider.ts:257-258builds and passes its target identically to Ollama's, so the same result applies there without a separate run.fix(memory): forward deadline control onReadinessWait to Ollama and L…
fix(memory): report managed local-service readiness from the Ollama a…
fix(memory): report managed local-service readiness from the Ollama a…