Summary
openclaw memory search <query> --json can print valid JSON results but keep the process alive when the QMD memory backend is active. Upstream callers then surface this as a timeout / embedding-provider style failure even though QMD itself is healthy and returns results quickly.
Environment
- OpenClaw:
2026.6.5
- Platform: macOS / Apple Silicon
- Memory backend: QMD CLI backend (
memory.backend=qmd)
Reproduction
openclaw memory search "QMD rebuild method" --json
Observed behavior in my environment:
- The command emits valid JSON search results.
- The process does not exit after output.
- A caller with a 15s timeout reports a
memory_search timeout / embedding-provider error.
Diagnostics
QMD itself appears healthy:
qmd doctor
qmd search "QMD rebuild method"
In my environment:
qmd doctor passes embedding freshness, fingerprint, and vector sample checks.
- direct
qmd search returns quickly.
openclaw memory search ... --json prints results, then hangs.
This makes the issue look like OpenClaw CLI/runtime exit handling after JSON output rather than a QMD index or embedding provider failure.
Local hotfix that resolves it
In the generated runtime, runMemorySearch() currently writes JSON and returns. Adding an explicit exit after JSON output resolves the hang locally:
if (opts.json) {
defaultRuntime.writeJson({ results });
setImmediate(() => process.exit(process.exitCode ?? 0));
return;
}
After this local patch:
openclaw memory search ... --json exits with code 0 in ~3s.
- the
memory_search tool returns successfully with provider qmd.
Expected behavior
After printing JSON for memory search --json, the CLI should exit cleanly with status 0 when the search succeeds, even if the QMD manager leaves handles open internally.
Summary
openclaw memory search <query> --jsoncan print valid JSON results but keep the process alive when the QMD memory backend is active. Upstream callers then surface this as a timeout / embedding-provider style failure even though QMD itself is healthy and returns results quickly.Environment
2026.6.5memory.backend=qmd)Reproduction
openclaw memory search "QMD rebuild method" --jsonObserved behavior in my environment:
memory_searchtimeout / embedding-provider error.Diagnostics
QMD itself appears healthy:
qmd doctor qmd search "QMD rebuild method"In my environment:
qmd doctorpasses embedding freshness, fingerprint, and vector sample checks.qmd searchreturns quickly.openclaw memory search ... --jsonprints results, then hangs.This makes the issue look like OpenClaw CLI/runtime exit handling after JSON output rather than a QMD index or embedding provider failure.
Local hotfix that resolves it
In the generated runtime,
runMemorySearch()currently writes JSON and returns. Adding an explicit exit after JSON output resolves the hang locally:After this local patch:
openclaw memory search ... --jsonexits with code 0 in ~3s.memory_searchtool returns successfully with providerqmd.Expected behavior
After printing JSON for
memory search --json, the CLI should exit cleanly with status 0 when the search succeeds, even if the QMD manager leaves handles open internally.