Skip to content

fix(memory): gateway search times out before remote embeddings finish - #139003

Closed
saladinyao-cyber wants to merge 2 commits into
openclaw:mainfrom
saladinyao-cyber:fix/memory-search-deadline-30s
Closed

saladinyao-cyber wants to merge 2 commits into
openclaw:mainfrom
saladinyao-cyber:fix/memory-search-deadline-30s

Conversation

@saladinyao-cyber

Copy link
Copy Markdown
Contributor

What Problem This Solves

Gateway memory_search currently aborts after 15 seconds, while remote embedding requests and their retry envelope can legitimately take longer. This makes otherwise healthy searches fail at the outer deadline before the provider operation can complete.

Why This Change Was Made

Raise only the existing gateway memory-search deadline from 15 seconds to 30 seconds. The abort propagation, stable deadline error, timer cleanup, and provider-level timeout behavior remain unchanged.

User Impact

Remote-backed memory searches get enough time to complete without removing the bounded request deadline or changing retry policy.

Evidence

  • Added a focused assertion for the 30-second default.
  • search-deadline.test.ts: 8/8 tests passed.
  • Oxlint: 0 warnings, 0 errors.
  • Oxfmt and git diff --check passed.
  • Rebased on current upstream main.

@clawsweeper

clawsweeper Bot commented Sep 5, 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.

@saladinyao-cyber
saladinyao-cyber force-pushed the fix/memory-search-deadline-30s branch from 63f221d to f75544e Compare September 5, 2026 10:28
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 5, 2026, 7:07 AM ET / 11:07 UTC.

ClawSweeper review

What this changes

The PR doubles Memory Core’s shared timeout from 15 to 30 seconds and updates tests, extending waits for agent searches, wiki-backed reads, and one-shot manager cleanup.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open: current main and v2026.9.1 retain the shorter deadline, and the companion PR explicitly excludes this change. The contribution remains useful, but its runtime benefit is unproven and its scope needs narrowing.

Priority: P2
Reviewed head: e8c5f3553683a1bda65f7908b3f1f4756acdf5aa

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A small, useful mitigation has focused timeout coverage, but collateral latency and missing runtime evidence prevent merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Needs real behavior proof before merge: supplied evidence covers unit checks, while the changed Memory Core tool deadline has no observed after-fix remote-backed search completing in the extended window. The separate memory.search RPC does not exercise this deadline. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Needs real behavior proof before merge: supplied evidence covers unit checks, while the changed Memory Core tool deadline has no observed after-fix remote-backed search completing in the extended window. The separate memory.search RPC does not exercise this deadline. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 11 items Verified introduced change: The pinned merge-base-to-head diff changes one production constant and five test files; no provider, dependency, authorization, or persistence implementation changes are introduced.
Current main still uses 15 seconds: The fetched main revision retains DEFAULT_MEMORY_SEARCH_TIMEOUT_MS = 15_000.
Latest release comparison: The same constant is 15_000 in v2026.9.1; the proposed timeout increase is not present in that release.
Findings 1 actionable finding [P2] Preserve read and cleanup deadlines when extending search
Security None None.

How this fits together

Memory Core supplies agent tools that retrieve indexed notes and optional wiki content. Its deadline limits how long those tools wait before returning results or an unavailable outcome.

flowchart TD
  A[Agent memory request] --> B[Memory Core tool]
  B --> C[Shared deadline]
  C --> D[Indexed memory and embeddings]
  C --> E[Optional wiki corpus]
  D --> F[Results or unavailable outcome]
  E --> F
  F --> G[One-shot manager cleanup]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Needs real behavior proof before merge: supplied evidence covers unit checks, while the changed Memory Core tool deadline has no observed after-fix remote-backed search completing in the extended window. The separate memory.search RPC does not exercise this deadline. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Preserve read and cleanup deadlines when extending search (P2) - This constant also controls memory_get through runMemoryCorpusDeadline and the awaited closeMemoryManagers cleanup. For memory_get with corpus: "all", a ready local result plus a hanging wiki supplement now withholds that result for 30 seconds instead of 15, despite performing no query embedding. A stalled one-shot cleanup similarly delays an already-completed search. Keep those existing budgets and extend the search budget separately instead of updating their tests to accept the extra delay.
  • Resolve merge risk (P1) - The shared increase adds up to 15 seconds of waiting to wiki-backed reads and one-shot cleanup, including cases where useful results are already available.
  • Resolve merge risk (P1) - No measured provider latency establishes that 30 seconds resolves the reported failure rather than moving it later.
  • Complete next step (P2) - Narrow the deadline change to search and supply after-fix evidence that a real remote-backed memory_search completes successfully within the extended budget.

Findings

  • [P2] Preserve read and cleanup deadlines when extending search — extensions/memory-core/src/memory/search-deadline.ts:1
Agent review details

Security

None.

PR surface

Source 0, Tests +8. Total +8 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 5 23 15 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 24 16 +8

Review metrics

Metric Value Why it matters
Production versus test growth Production net 0; tests net +8 The implementation adds no production structure; growth is confined to the default-value assertion and its import.
Shared deadline scope 1 default doubled: 15s → 30s across search, corpus reads, and cleanup The changed wait budget reaches beyond remote embedding searches.

Merge-risk options

Maintainer options:

  1. Limit the longer wait to search (recommended)
    Preserve 15-second read and cleanup guards while applying the justified larger budget to tool searches.

Technical review

Best possible solution:

Size the bounded tool-search budget from observed embedding latency while preserving the existing read and cleanup deadlines, cancellation, and cooldown behavior.

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

Yes, from source: an agent tool search still awaiting embeddings at 15 seconds is aborted, and a hanging wiki supplement delays otherwise-ready reads to the shared deadline. No real-provider reproduction was supplied or executed.

Is this the best way to solve the issue?

Unclear as a complete fix: increasing the search budget is plausible, but 30 seconds remains below the embedding owner's retry envelope and unnecessarily extends unrelated read and cleanup waits.

Full review comments:

  • [P2] Preserve read and cleanup deadlines when extending search — extensions/memory-core/src/memory/search-deadline.ts:1
    This constant also controls memory_get through runMemoryCorpusDeadline and the awaited closeMemoryManagers cleanup. For memory_get with corpus: "all", a ready local result plus a hanging wiki supplement now withholds that result for 30 seconds instead of 15, despite performing no query embedding. A stalled one-shot cleanup similarly delays an already-completed search. Keep those existing budgets and extend the search budget separately instead of updating their tests to accept the extra delay.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 49ecde890905.

Labels

Label changes:

  • add P2: This is a bounded memory-retrieval improvement without evidence of an urgent widespread outage.
  • add merge-risk: 🚨 availability: Stalled wiki reads and manager cleanup can hold completed tool results for an additional 15 seconds.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Needs real behavior proof before merge: supplied evidence covers unit checks, while the changed Memory Core tool deadline has no observed after-fix remote-backed search completing in the extended window. The separate memory.search RPC does not exercise this deadline. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded memory-retrieval improvement without evidence of an urgent widespread outage.
  • merge-risk: 🚨 availability: Stalled wiki reads and manager cleanup can hold completed tool results for an additional 15 seconds.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Needs real behavior proof before merge: supplied evidence covers unit checks, while the changed Memory Core tool deadline has no observed after-fix remote-backed search completing in the extended window. The separate memory.search RPC does not exercise this deadline. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Ilya Kuprov: 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)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Preserve the read and cleanup deadlines while narrowing the longer budget to tool search.
  • Add tool-boundary coverage showing a result arriving between 15 and 30 seconds succeeds, alongside timeout and cancellation checks.
  • Attach redacted after-fix terminal output or logs showing the real tool search succeeds with slow remote embeddings; a terminal screenshot or recording is welcome. Remove keys, IP addresses, private endpoints, and personal data. Updating the PR body should trigger review; otherwise ask a maintainer for @clawsweeper re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

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 merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS 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.

1 participant