fix(memory): refresh status dirty sessions#97836
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: #97857 is the stronger open landing path for the same memory status false-clean bug, while this branch still starts the dirty-session scan fire-and-forget and can race the synchronous status read. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: GitHub search found three open PRs targeting the same memory status dirty false-clean issue; this branch and #97842 are competing candidates, while #97857 is proof-positive. So I’m closing this here and keeping the remaining discussion on #97857 and #97842. Review detailsBest possible solution: Land #97857 as the canonical awaited status-mode dirty detection fix, then close or redirect the competing same-issue PRs. Do we have a high-confidence way to reproduce the issue? Yes by source inspection: status-purpose managers are transient and plain status immediately reads synchronous Is this the best way to solve the issue? No. This branch starts the catch-up asynchronously from the constructor, while the sibling PR uses an awaited factory approach and directly tests the actual status-purpose manager flow. Security review: Security review cleared: The diff only changes memory-core runtime and test files; it does not touch dependencies, CI, package metadata, secrets, permissions, downloads, or other supply-chain surfaces. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 6cb82eaab865. |
|
Updated PR body with explicit @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Fixes memory status reporting stale
dirty=falsefor session transcripts that have been usage-counted but not yet indexed.Issue
Fixes #97814.
Changes
Testing
node scripts/run-vitest.mjs extensions/memory-core/src/memory/manager-sync-ops.startup-catchup.test.ts— 16 tests passed/root/.hermes/oss-contrib/worktrees/openclaw__openclaw/node_modules/.bin/oxfmt --check --threads=1 extensions/memory-core/src/memory/manager.ts extensions/memory-core/src/memory/manager-sync-ops.ts extensions/memory-core/src/memory/manager-sync-ops.startup-catchup.test.ts— passedgit diff --check && git diff --cached --check— passedWhat Problem This Solves
Fixes #97814. Memory status could report
dirty=falsefor session transcripts that had already been usage-counted but had not yet been indexed. That made the status view look clean while a startup catch-up dirty mark was still required.Evidence
node scripts/run-vitest.mjs extensions/memory-core/src/memory/manager-sync-ops.startup-catchup.test.ts— 16 tests passedoxfmt --check --threads=1 extensions/memory-core/src/memory/manager.ts extensions/memory-core/src/memory/manager-sync-ops.ts extensions/memory-core/src/memory/manager-sync-ops.startup-catchup.test.ts— passedgit diff --check && git diff --cached --check— passed