Repository navigation
fix(memory-core): don't run the LLM reranker in vsearch/search modes - #88887
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 9:05 PM ET / 01:05 UTC. Summary PR surface: Source +7, Tests +40. Total +47 across 2 files. Reproducibility: yes. source-reproducible with high confidence: current main omits Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this narrow runtime/test fix, or an equivalent maintainer-owned patch, so QMD mcporter Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with high confidence: current main omits Is this the best way to solve the issue? Yes. Setting AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 081f8fd1fa68. Label changesLabel justifications:
Evidence reviewedPR surface: Source +7, Tests +40. Total +47 across 2 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
|
43191f6 to
05d3ac2
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
vsearch/search are documented as vector/lexical-only modes, but runQmdSearchViaMcporter omitted `rerank` from the query tool callArgs, so QMD's query tool (which defaults rerank:true) ran the LLM reranker anyway. Pass rerank:false for those modes; full "query" mode keeps it. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
05d3ac2 to
a1b31ef
Compare
…penclaw#88887) vsearch/search are documented as vector/lexical-only modes, but runQmdSearchViaMcporter omitted `rerank` from the query tool callArgs, so QMD's query tool (which defaults rerank:true) ran the LLM reranker anyway. Pass rerank:false for those modes; full "query" mode keeps it. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…penclaw#88887) vsearch/search are documented as vector/lexical-only modes, but runQmdSearchViaMcporter omitted `rerank` from the query tool callArgs, so QMD's query tool (which defaults rerank:true) ran the LLM reranker anyway. Pass rerank:false for those modes; full "query" mode keeps it. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
What
searchMode: "vsearch"/"search"are documented as vector/lexical-only modes that must not do LLM work —buildV2Searches' own doc comment says they exist "so lexical-only or vector-only modes don't trigger unnecessary LLM/embedding work." ButrunQmdSearchViaMcporterbuildscallArgswithoutrerank, and QMD's unifiedquerytool defaultsrerank: true. So everyvsearch/searchmemory search silently runs the LLM reranker anyway. QMD's own tool docs flag it: "rerank … (default: true). Set to false for faster results on CPU-only machines."Fix
Pass
rerank: falseforsearch/vsearchinrunQmdSearchViaMcporter(fullquerymode keeps reranking). The cold/CLI path (buildSearchArgs) is unaffected — it already maps each mode to qmd's dedicatedvsearch/searchsubcommands, which don't rerank.Real behavior proof (required for external PRs)
searchMode: "vsearch"/"search", every memory search silently invoked QMD's LLM reranker.runQmdSearchViaMcporteromittedrerankfrom the querycallArgsand QMD'squerytool defaultsrerank: true, contradicting those modes' vector/lexical-only contract.qmd mcprunning on an Intel UHD 630 iGPU (Gen9.5), host Linux 7.0.6-2-pve. Each case below is a freshqmd mcpprocess fed exactly thecallArgsopenclaw builds; host kernel watched viadmesg.qmd mcpclient that calls thequerytool with the patched vsearch args{"searches":[{"type":"vec","query":"how do I handle errors gracefully"}],"limit":3,"rerank":false}, and compared it against the unpatched args (norerank). Command:node demo.mjs false→ spawnsqmd mcp, sendstools/call query.rerank:false, returns 3 hits with zero host-kernel GPU hangs and no reranker invoked; the unpatched path errors withErrorDeviceLostand produces 3 kernel GPU hangs. In my deployment, warm memory recall went from a CPU-fallback spin to ~126 ms on the GPU.vector_search/search) on real hardware — only the v2 unifiedquerytool was exercised live (the new unit test covers the v2 mcportercallArgs); and non-iGPU reranker hardware.ErrorDeviceLost+ 3 kernel GPU hangs;dmesgexcerpt included).Tests and validation
vsearchmode sendsrerank: falsevia mcporter (and the existingquery-mode test still asserts it does not).pnpm test:extension memory-corepasses; type-check (pnpm tsgo:test) clean.dreaming-phases.test.ts > suppresses cleanup warnings during request-scoped narrative fallback, is already red on cleanmain(verified by stashing this change) and is unrelated to this PR.🤖 AI-assisted — implemented with an AI coding agent; the real-behavior proof above is from my own live OpenClaw setup, not AI-generated. Allow edits by maintainers enabled. No
CHANGELOG.mdchange (per CONTRIBUTING).