fix(memory): respect QMD timeout for memory_search#95757
Conversation
e8e3e59 to
7362978
Compare
Local before/after behavior proofRedaction note: this is from a local QMD-backed OpenClaw install. Local user, agent, room, host, and filesystem identifiers are omitted or redacted. Before, pre-patch
{
"results": [],
"disabled": true,
"unavailable": true,
"error": "memory_search timed out after 15s",
"warning": "Memory search is unavailable due to an embedding/provider error.",
"action": "Check embedding provider configuration and retry memory_search.",
"debug": {
"error": "memory_search timed out after 15s"
}
}The same pre-patch runtime also showed the hardcoded deadline feeding After, patched local runtime
{
"provider": "qmd",
"model": "qmd",
"mode": "vsearch",
"debug": {
"backend": "qmd",
"configuredMode": "vsearch",
"effectiveMode": "vsearch",
"searchMs": 23922,
"hits": 8
}
}
|
|
Codex review: stale review; fresh review needed. Summary Next step Review history (6 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Maintainer repair is pushed in cb42cc5993. Thanks @bdjben for the original fix and local >15-second QMD evidence; the final commit keeps you as co-author. What changed:
Exact proof on this head:
Known proof gaps: none for the changed memory-core behavior. CI is running on the pushed SHA; final preparation/merge remains intentionally serialized. |
Preserve the phase-scoped QMD timeout semantics on current main. Co-authored-by: Peter Steinberger <[email protected]>
cb42cc5 to
756639b
Compare
|
Refreshed this branch onto current What remains intentional:
Verification on the refreshed head (
The branch was independently reviewed after the refresh; no blocker was found. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready at Maintainer reconciliation keeps the 15-second default around setup, maintenance, builtin, supplement, and cleanup phases; only the QMD query subprocess uses Proof:
Known proof gap: the live QMD scenario predates the final current-main merge; no PR runtime path changed after that proof. No contributor changelog edit; release-note context is preserved in the PR body. |
|
Merged via squash.
|
* fix(memory): scope qmd search deadline Preserve the phase-scoped QMD timeout semantics on current main. Co-authored-by: Peter Steinberger <[email protected]> * docs: refresh generated docs map * test(memory): reconcile manager mock with current main * test(memory): isolate deadline mock import * style(memory): format search test mocks * test(memory): decouple mock from deadline symbol * chore(memory): refresh reviewed pull request head --------- Co-authored-by: Benjamin Badejo <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
* fix(memory): scope qmd search deadline Preserve the phase-scoped QMD timeout semantics on current main. Co-authored-by: Peter Steinberger <[email protected]> * docs: refresh generated docs map * test(memory): reconcile manager mock with current main * test(memory): isolate deadline mock import * style(memory): format search test mocks * test(memory): decouple mock from deadline symbol * chore(memory): refresh reviewed pull request head --------- Co-authored-by: Benjamin Badejo <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes #91947.
QMD-backed
memory_searchcan legitimately take longer than the historical fixed 15-second whole-tool deadline, even though QMD already exposesmemory.qmd.limits.timeoutMs. As a result, configured longer QMD searches were aborted before their QMD-owned budget elapsed.Why This Change Was Made
The final implementation assigns deadlines at their owner boundaries:
memory.qmd.limits.timeoutMsgoverns only the actual QMDquery/search/vsearchsubprocess or mcporter call.This PR began with @bdjben's focused fix and local 23.9-second QMD proof. The maintainer repair preserves that credit while removing the broader whole-manager exemption and QMD close override from the earlier patch. The final test mock forwards the private symbol-keyed deadline option without importing the production deadline module, keeping current-main debug typing at its owner and avoiding a recurring merge conflict.
User Impact
Users who intentionally raise
memory.qmd.limits.timeoutMscan now complete slow QMD-backed agent memory searches beyond 15 seconds. Non-QMD work and QMD-to-builtin fallback remain bounded by the existing default deadline, so raising the QMD timeout does not extend setup, wiki, supplement, builtin, or cleanup work.No config, schema, storage, protocol, plugin SDK, or dependency surface is added.
Evidence
dcd0e5040012cc67fee63204a287c56edb00ad8a, including basead1b4d9731709430757c8776ff8e99602589d8ec.tbx_01kxd3jvggptc47g9yanc6772p, Actions run 29229938011: 230/230 passed across deadline, tools, search manager, QMD manager, and host-process tests.tbx_01kxd0x0ggc0029as1e8vwwmyt, Actions run 29227656913: 230/230 passed across the same owner/dependency surfaces.createMemorySearchToolcompleted with backendqmd, five hits, 28.356 seconds wall time / 27.081 seconds search time under a configured 300-second QMD budget.git diff --checkpassed.No
CHANGELOG.mdedit; release generation owns changelog entries.