Repository navigation
fix(memory): suggest reindex, not --fix, for a missing qmd index - #116958
Conversation
`memory status` always appended "Fix: openclaw memory status --fix" when any audit issue was present, even when none of the issues were actually repaired by --fix. A missing qmd index file (qmd-index-missing) is marked fixable: false, so running the suggested --fix left the issue unresolved. Gate the --fix hint on at least one fixable issue, and suggest `openclaw memory index --agent <id>` (which builds a fresh index) when the qmd index file is missing.
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 1:37 PM ET / 17:37 UTC. ClawSweeper reviewWhat this changesThe PR changes Memory Core status guidance so a missing QMD index recommends reindexing, while Merge readiness✅ Ready for maintainer review This PR remains necessary: current Priority: P2 Review scores
Verification
How this fits togetherMemory Core is OpenClaw’s bundled local-memory plugin. Its status command combines memory-manager state with artifact audits, while its index command drives the selected backend’s synchronization path and reports the result. flowchart LR
A[Operator runs memory status] --> B[Memory Core status command]
B --> C[Artifact audit]
C --> D{Repairable or missing QMD index?}
D --> E[Status repair guidance]
E --> F[Operator runs memory index]
F --> G[QMD synchronization]
G --> H[Updated index and status]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +8, Tests +28. Total +36 across 2 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Land the focused status-guidance change so missing QMD indexes direct operators to the existing index command while genuinely repairable audit findings retain the Do we have a high-confidence way to reproduce the issue? Yes—source confirms that a QMD status with a missing index emits the blanket Is this the best way to solve the issue? Yes—the patch corrects the existing guidance boundary and delegates recovery to the already-owned index command, rather than broadening AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 47adae976966. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…odels-20260729 * origin/main: fix(tui): canonical terminal outcomes, cancellation, and error privacy (#117044) fix(cron): avoid phantom message tool guidance (#116908) fix(test): avoid macOS release gate deadlocks (#116972) fix(openai): canonical Chat cache-hit and billing accounting (#117043) fix(memory-wiki): salvage human Notes before pruning imported source pages (#102294) fix(memory): suggest reindex, not --fix, for a missing qmd index (#116958) chore(msteams): add private Gateway QA adapter fix(ui): make session controls and failures accessible (#117019) docs: fix tilde paths in CLI output examples (#114595) fix(plugins): canonical discovery diagnostics and deterministic lifecycles (#117025) fix(ui): honor Gateway readiness abort and subscription ownership (#117048) fix(updater): harden launchd replacement timing (#117030) fix(gateway): preserve static asset HEAD representation metadata (#117049) fix(gateway): abort embeddings when clients disconnect (#116146) fix(googlechat): retain fallback thread continuity (#117053)
…nclaw#116958) `memory status` always appended "Fix: openclaw memory status --fix" when any audit issue was present, even when none of the issues were actually repaired by --fix. A missing qmd index file (qmd-index-missing) is marked fixable: false, so running the suggested --fix left the issue unresolved. Gate the --fix hint on at least one fixable issue, and suggest `openclaw memory index --agent <id>` (which builds a fresh index) when the qmd index file is missing.
What Problem This Solves
Fixes #116937.
When an agent has no qmd store at all (0 files, no index — not a stale
one),
openclaw memory status --agent <id>reports the audit issue"QMD index file is missing." followed by a blanket hint:
Running that suggested
--fixreturnsRepair: no changesand leavesthe problem unresolved. Per
--help,--fixonly repairs stale recalllocks and normalizes promotion metadata — it has no code path that
creates a missing qmd index. The audit issue for a missing qmd index
(
qmd-index-missing) is already markedfixable: falseinshort-term-promotion-artifacts.ts, butcli-status.runtime.tsalwaysprinted the
--fixhint whenever any audit issue existed, regardlessof whether that issue was actually repairable by
--fix.Why This Change Was Made
extensions/memory-core/src/cli-status.runtime.tsbuilds the "Issues"section of
memory statusfromaudit.issues/dreamingAudit.issues, each of which already carries afixableboolean. The fix hint should reflect that flag instead of firing
unconditionally:
Fix: openclaw memory status --fix --agent <id>when atleast one present issue is actually
fixable: true(applies to boththe short-term promotion audit and the dreaming-artifacts audit).
qmd-index-missing), printFix: openclaw memory index --agent <id>instead —memory indexruns the manager's
sync/reindex path, which creates the missingindex from scratch (confirmed by reading
extensions/memory-core/src/cli-index-search.runtime.ts, whererunMemoryIndexcallssyncFnand only stats the resulting db fileafterward).
This is the minimal fix described as option 2 in the issue: change the
suggested remediation message rather than teaching
--fixa new,unrelated repair path.
User Impact
Operators debugging an agent with a missing memory index now get a
command that actually resolves the problem, instead of being sent down
a dead-end (
--fixreporting "no changes"). No behavior changes forany issue that
--fixcan actually repair.Evidence
Added a test in
extensions/memory-core/src/cli.test.ts:"suggests reindexing instead of --fix when the qmd index is missing".It sets a qmd-backend status pointing at a nonexistent db path and
asserts the output contains
Fix: openclaw memory index --agent mainand does not contain
Fix: openclaw memory status --fix --agent main.Confirmed the test fails without the fix (reverted only
cli-status.runtime.tsviagit checkout HEAD~1 -- extensions/memory-core/src/cli-status.runtime.ts, ran the test, sawthe old blanket
Fix: openclaw memory status --fix --agent mainhintprinted instead), then restored the fix and re-ran:
Also ran, both clean:
AI-assistance disclosure: this change was authored with the assistance
of an AI coding agent (Claude), reviewed and validated as described
above before being pushed.
Real QMD Behavior Proof
Requested by ClawSweeper review: a redacted terminal transcript from a
real QMD-backed agent showing the missing-index status,
openclaw memory index --agent <id>running, and the follow-up status no longerreporting the missing-index condition.
Ran against a real
qmdbinary (npm install -g @tobilu/qmd, v2.5.3)in an isolated
HOME/state dir (no mocks, no CLI-internal testharness):
Before the fix (missing index,
mainhad the unconditional hint), thelast line of the first status run would instead have been
Fix: openclaw memory status --fix --agent main, which repairs nothing forthis issue. With the fix, the hint is
openclaw memory index --agent main, and running it creates the real QMDindex.sqlitefromscratch, after which the "QMD index file is missing." issue and its
hint no longer appear in status output — confirming
memory indexresolves the exact reported condition end-to-end against a real QMD
sidecar.