Skip to content

fix(memory): prevent local cold starts from timing out searches - #143286

Closed
PeterHodl wants to merge 5 commits into
openclaw:mainfrom
PeterHodl:fix/managed-local-memory-cold-start
Closed

PeterHodl wants to merge 5 commits into
openclaw:mainfrom
PeterHodl:fix/managed-local-memory-cold-start

Conversation

@PeterHodl

Copy link
Copy Markdown

Closes #143169

What Problem This Solves

Fixes an issue where users of a managed local embedding service could see memory_search time out after 15 seconds while the service was still starting successfully within its configured localService.readyTimeoutMs.

This is especially visible on lower-power hosts where loading the embedding model after an idle shutdown can take longer than the normal search deadline.

Why This Change Was Made

The managed local-service acquisition/readiness phase now suspends the outer search deadline. That phase remains bounded by the service owner's existing readyTimeoutMs, and caller cancellation still aborts immediately. Once the service is ready, the remaining normal 15-second search budget resumes.

The deadline scope is request-local through async context so concurrent searches sharing a manager do not affect one another. This does not add a new configuration field or extend the deadline for remote providers or ordinary search work.

User Impact

The first memory search after a managed local embedding service has stopped can wait for the configured startup window instead of failing at the global 15-second search limit. Warm searches and all work after readiness retain the existing timeout behavior.

Evidence

  • Focused Vitest coverage: 27 tests passed across search-deadline.test.ts and embeddings.test.ts.
  • Added regression coverage for a 30-second managed startup under a 15-second search deadline.
  • Added cancellation coverage during the suspended startup phase.
  • Formatting, focused oxlint, git diff --check, max-lines ratchet, and assertion-safety ratchet passed locally.
  • Real-world reproduction on Raspberry Pi / Debian 12: the cold search failed at 15 seconds; temporarily raising the outer limit allowed it to complete in 38.9 seconds, while a warm search completed in 6.7 seconds.
  • The remaining repository-wide checks are delegated to GitHub CI because the full local suite exceeds the test host's available memory.

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@PeterHodl
PeterHodl marked this pull request as ready for review September 9, 2026 17:20
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

The merged replacement #143590 addresses the same cold-start failure and is present on current main. No distinct requested behavior remains for this branch to deliver.

Root-cause cluster
Relationship: superseded
Canonical: #143590
Summary: The merged replacement owns the same managed-readiness timeout repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Retain the merged readiness-owner implementation and its independent search budgets rather than land a second timeout mechanism.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Retain the merged readiness-owner implementation and its independent search budgets rather than land a second timeout mechanism.

Do we have a high-confidence way to reproduce the issue?

No current-main failure was reproduced; inspected source and regression coverage show that managed readiness now pauses the search budget.

Is this the best way to solve the issue?

Yes—the merged replacement resolves the problem at the readiness owner, including query watchdogs and separate wiki deadlines, without requiring this branch’s alternative mechanism.

Security review:

Security review cleared: The introduced diff changes timeout accounting without adding dependencies, persistence, permissions, or an authorization boundary.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • wangmiao0668000666: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Codex review notes: model internal, reasoning medium; reviewed against a18d4e4962f5; fix evidence: commit 874b2ce292f4, main fix timestamp 2026-09-10T05:49:46Z.

@PeterHodl PeterHodl closed this Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-core Extension: memory-core P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

memory_search aborts managed local embedding cold start before ready timeout

1 participant