fix(memory-core): skip forced sync for healthy zero-hit search#95595
fix(memory-core): skip forced sync for healthy zero-hit search#95595Lestat569769 wants to merge 1 commit into
Conversation
|
Codex review: needs changes before merge. Reviewed June 22, 2026, 12:45 AM ET / 04:45 UTC. Summary PR surface: Source +51, Tests +96. Total +147 across 3 files. Reproducibility: yes. Current main and v2026.6.9 still await forced sync after zero memory_search results, QMD sync awaits update maintenance, and the canonical issue includes live reports of 70s-class stalls; I did not rerun a live large-corpus QMD timing repro in this read-only review. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land one canonical memory-core fix that keeps QMD zero-hit update work out of the interactive memory_search path while explicitly preserving or accepting the desired freshness semantics, then reconcile the overlapping PRs. Do we have a high-confidence way to reproduce the issue? Yes. Current main and v2026.6.9 still await forced sync after zero memory_search results, QMD sync awaits update maintenance, and the canonical issue includes live reports of 70s-class stalls; I did not rerun a live large-corpus QMD timing repro in this read-only review. Is this the best way to solve the issue? Yes, this is an acceptable narrow mitigation after the latest narrowing because it stays in the memory-core tool path and preserves dirty non-QMD retry. The best merge state still requires maintainer acceptance of the latency-versus-freshness policy, or a bounded/background refresh variant if immediate freshness must stay. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a594d2ce7325. Label changesLabel justifications:
Evidence reviewedPR surface: Source +51, Tests +96. Total +147 across 3 files. 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
|
c8d0051 to
bf0eb56
Compare
bf0eb56 to
143de2d
Compare
|
Updated the PR for the disabled-vector/FTS readiness finding and added inspectable focused test output plus runtime/status proof in the PR body. @clawsweeper re-review |
143de2d to
925495a
Compare
|
Patch update for ClawSweeper review:
Focused verification: Result: |
What Problem This Solves
A valid memory search can return zero hits while the index is marked dirty even though the index is otherwise healthy. Before this fix, the tool wrapper treated that dirty-only zero-hit as a reason to call
manager.sync({ reason: "search", force: true })and wait inside the tool call. On hosts where the forced sync does not complete quickly,memory_searchcan hang until the tool timeout even though the correct user-facing answer is simply an empty result set.This patch keeps the recall-preserving retry for non-QMD dirty indexes while preventing the QMD healthy dirty-only zero-hit path from forcing a blocking sync. Missing, invalid, empty, or unavailable index states still force sync.
Summary
Evidence
Focused local verification on branch head
925495a4:Result:
Regression coverage now includes:
shouldForceSyncAfterZeroResultsreturnshealthy_zero_hitfor QMD dirty healthy zero-hit statusshouldForceSyncAfterZeroResultsreturnsdirty_indexfor builtin or unknown dirty healthy zero-hit statusreturns a healthy zero-hit without forcing sync when the index is readyasserts one search call and zero sync callspreserves the dirty zero-hit retry for non-qmd backendsasserts the wrapper syncs once, searches twice, and returns the second-search resultavailable: falsedo not make the index unhealthyLive installed-runtime proof before source promotion:
openclaw memory status --jsonreported indexed and ready memory withfiles: 159,chunks: 2519,dirty: false, enabled/available FTS and vector, andcustom.indexIdentity.status: valid0results in about491.6mswithforcedSync.attempted=falseandforcedSync.reason=healthy_zero_hitafter gateway reloadSafety Boundaries