fix(memory-core): force exit after memory search --json output#91864
fix(memory-core): force exit after memory search --json output#91864bladin wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 10, 2026, 2:34 AM ET / 06:34 UTC. Summary PR surface: Source +13. Total +13 across 1 file. Reproducibility: yes. the linked report gives a concrete QMD command and environment, and current main's source shows the JSON path writes results and returns while relying on normal process shutdown. I did not run a live QMD reproduction in this read-only review. Review metrics: 1 noteworthy metric.
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: Keep the QMD CLI termination mitigation, but schedule it after stdout/stderr flush and required recall/manager cleanup have settled, then attach live QMD terminal proof that JSON output is valid and the command exits. Do we have a high-confidence way to reproduce the issue? Yes, the linked report gives a concrete QMD command and environment, and current main's source shows the JSON path writes results and returns while relying on normal process shutdown. I did not run a live QMD reproduction in this read-only review. Is this the best way to solve the issue? No. A forced CLI exit may be an acceptable mitigation for lingering QMD handles, but this implementation exits too close to async stdout, recall tracking, and manager cleanup. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 7b7e8f6e88e7. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +13. Total +13 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 in favor of #91837, which landed as 9408380. Both PRs address #91821, but #91837 fixes the lifecycle at the QMD manager boundary by preventing transient CLI managers from scheduling background sync/embed work. This avoids forcing the entire process to exit after JSON output and preserves normal cleanup plus best-effort recall work. |
Summary
Fixes #91821 -
memory search --jsoncommand hanging after output with QMD backend.When using
openclaw memory search <query> --jsonwith QMD backend, the process would hang after printing JSON results because QMD leaves internal handles (database connections, file descriptors) open, preventing Node.js from naturally exiting.Changes
extensions/memory-core/src/cli.runtime.ts:runMemorySearch()to force exit after JSON output!process.env.VITESTguard to avoid breaking testsReal behavior proof
Behavior addressed:
openclaw memory search --jsoncommand hanging after printing JSON results when using QMD backend.Real environment tested: Local source checkout with Node.js 22.19+.
Exact steps:
Evidence after fix:
process.exiterrors in test outputWhat was not tested: Live QMD backend integration test with actual memory search. The fix follows the exact pattern suggested in the issue report and passes all unit tests.
Verification
node scripts/run-vitest.mjs extensions/memory-core/src/cli.test.ts --no-coverage- 67/68 tests passnode -c extensions/memory-core/src/cli.runtime.ts- syntax check passesFixes #91821.