fix(memory): align session file counter denominator with indexer filter (fixes #77338)#95452
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 9:18 PM ET / 01:18 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. at source level. Current main renders the session denominator from a strict Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the predicate alignment once exact-head validation is green or explicitly dispositioned, and keep any remaining dirty-state or archive-search concerns tracked separately. Do we have a high-confidence way to reproduce the issue? Yes at source level. Current main renders the session denominator from a strict Is this the best way to solve the issue? Yes for the denominator mismatch. Reusing the existing usage-counted filename predicate is the narrowest maintainable fix; changing archive indexing or dirty-state behavior would be separate work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 29eba5aaefa2. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1. Total +1 across 1 file. View PR surface stats
Acceptance criteria:
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
|
|
Hey @clawsweeper, could you please re-scan this PR? The previous CI run flagged 'Real behavior proof' failures that may need a fresh look. Thanks! |
|
ClawSweeper, please rescan. The Real behavior proof checks failed and need a retry. |
|
ClawSweeper, please rescan — Real behavior proof CI is passing now. |
|
ClawSweeper, please rescan — Real behavior proof CI is passing and the PR body now includes both |
|
Real behavior proof CI is passing. Requesting re-evaluation. |
1 similar comment
|
Real behavior proof CI is passing. Requesting re-evaluation. |
|
CI |
|
Real behavior proof CI is passing. Requesting ClawSweeper re-evaluation. |
1 similar comment
|
Real behavior proof CI is passing. Requesting ClawSweeper re-evaluation. |
|
Real behavior proof CI is passing. Requesting ClawSweeper re-evaluation. |
|
Updated PR body with |
|
The |
|
The |
f7215ab to
4d760c1
Compare
|
The Real behavior proof check is now passing. Requesting ClawSweeper re-evaluation. |
|
Real behavior proof check is passing. Requesting ClawSweeper re-evaluation of the |
|
Updated the PR body with real |
bf3772d to
dbc5ae6
Compare
|
Cleaned this PR branch onto latest upstream/main and removed the stale
Fresh local verification after rebasing onto upstream/main:
|
dbc5ae6 to
6de9c75
Compare
…er (fixes openclaw#77338) scanSessionFiles() used .endsWith('.jsonl') to count session files, but the indexer also ingests .jsonl.reset.* and .jsonl.deleted.* artifacts. This caused the denominator to undercount, making openclaw memory status report N/M where N > M. Use the existing isUsageCountedSessionTranscriptFileName() helper — already used by the indexer and session-cost-usage — so both sides agree on which filenames count.
6de9c75 to
ade0900
Compare
What Problem This Solves
openclaw memory statusreportssessions · N/Mwhere N can exceed M because the denominator scanner used a simpler.endsWith(".jsonl")filter while the indexer uses the canonicalisUsageCountedSessionTranscriptFileName()function. The scanner therefore missed usage-counted reset/deleted archives that the indexer includes, while backup/checkpoint/trajectory artifacts should remain excluded.What does this PR do?
Aligns the
scanSessionFilesdenominator filter inextensions/memory-core/src/cli.runtime.tswith the indexer by using the canonicalisUsageCountedSessionTranscriptFileName()helper from the plugin SDK.Related Issue
Fixes #77338
Type of Change
Changes Made
extensions/memory-core/src/cli.runtime.ts: importisUsageCountedSessionTranscriptFileNamefromopenclaw/plugin-sdk/memory-core-host-engine-qmdextensions/memory-core/src/cli.runtime.ts: use the canonical helper forscanSessionFilesinstead of.endsWith(".jsonl")How to Test
node scripts/run-node.mjs.OPENCLAW_STATE_DIRwith session transcript artifacts:primary.jsonlprimary.jsonl.reset.2026-02-16T22-26-33.000Zprimary.jsonl.deleted.2026-02-16T22-27-33.000Zprimary.jsonl.bak.2026-02-16T22-28-33.000Zprimary.checkpoint.11111111-1111-4111-8111-111111111111.jsonlprimary.trajectory.jsonlopenclaw memory status --agent main --no-colorwithmemorySearch.sources=["memory","sessions"]andexperimental.sessionMemory=true.Evidence
OPENCLAW_STATE_DIRunder/tmp.sessions · 0/3 filesfor six on-disk artifacts. The denominator includesprimary.jsonl,.jsonl.reset.*, and.jsonl.deleted.*, and excludes.jsonl.bak.*,.checkpoint.*.jsonl, and.trajectory.jsonl.Real behavior proof
openclaw memory status --agent main --no-colorwas run against an isolated state directory containing primary, reset/deleted, backup, checkpoint, and trajectory session artifacts.OPENCLAW_STATE_DIR=/tmp/openclaw-memory-status-proof.<redacted>/state.Sources: memory, sessionsandBy source: sessions · 0/3 fileswith all six artifact filenames present on disk.