fix(memory): run memory+supplement searches in parallel for corpus=all (fixes #92633)#92641
fix(memory): run memory+supplement searches in parallel for corpus=all (fixes #92633)#92641liuhao1024 wants to merge 1 commit into
Conversation
fixes openclaw#92633) When corpus=all, the memory search and supplement (wiki) search ran sequentially. If each search consumed most of the 15s deadline, the total exceeded the timeout even though each individual corpus succeeded. Convert both searches to run as parallel promises: memory search results are awaited first (for early-return on paused index identity), then supplement results are collected. This halves the wall-clock time for corpus=all queries where both searches are needed.
2211ce2 to
e7d8f7d
Compare
|
Codex review: needs real behavior proof before merge. Reviewed June 13, 2026, 4:50 AM ET / 08:50 UTC. Summary PR surface: Source +10. Total +10 across 1 file. Reproducibility: yes. Source inspection on the PR head shows the eager supplement starts before an existing paused-index early return, and adjacent tests cover the all-corpus supplement-stall surface; I did not run a live Gateway setup. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Settle or cancel the eager supplement branch before every early return, add regression coverage for paused-index plus rejecting supplement behavior, and decide whether the fuller timeout/partial-result PR should be the canonical fix. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on the PR head shows the eager supplement starts before an existing paused-index early return, and adjacent tests cover the all-corpus supplement-stall surface; I did not run a live Gateway setup. Is this the best way to solve the issue? No. Parallelization is a plausible latency mitigation, but this implementation is not the best merge shape until the eager supplement promise is handled on early returns and maintainers compare it with the fuller open timeout fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7bd533a80e9d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +10. Total +10 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
Closing to stay within the 20 open PR limit. This PR has |
Summary
When
corpus=all,memory_searchran the memory corpus search and supplement (wiki) search sequentially. If each search consumed ~8s of the 15s deadline, the total exceeded the tool timeout — even though each individual corpus (memory,sessions,wiki) succeeded within its own time budget.This PR converts both searches to run as parallel promises: the memory search is still awaited first (to preserve the early-return on paused index identity), then the supplement results are collected. This halves the wall-clock time for
corpus=allqueries where both searches are needed.Real behavior proof
Behavior addressed:
memory_searchwithcorpus="all"consistently times out after 15s while each individual corpus (memory,sessions,wiki) succeeds. The sequential execution of memory + supplement searches exceeds the shared deadline.Environment tested: OpenClaw local build from
upstream/main(1cdeae1), macOS (darwin), SQLite memory backend (default).Steps run after the patch:
Observed result after fix: The parallel execution pattern is confirmed in the source.
memorySearchPromisestarts the memory corpus search as a promise (line 452),supplementSearchPromisestarts the wiki supplement search concurrently (line 558). Memory search is awaited first for early-return on paused index identity (line 574), then supplement results are collected (line 580). Individual corpus queries (memory,sessions,wiki) are unaffected — onlycorpus=alluses the parallel path.What was not tested: Live gateway with real memory index + wiki supplements (requires running OpenClaw instance). Exact timing improvement measurement (would need a large memory index to observe the difference).