fix(memory): align session file counter denominator with indexer filter#93602
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(memory): align session file counter denominator with indexer filter#93602liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
The scanSessionFiles counter used entry.name.endsWith('.jsonl') to
count session transcript files, but the indexer at
src/infra/session-cost-usage.ts:386 uses
isUsageCountedSessionTranscriptFileName() which filters out non-session
.jsonl files (archives, checkpoints, etc.).
This mismatch inflates the totalFiles count shown in the memory status
CLI, confusing operators who compare it against the actual indexed
session count.
Use the same isUsageCountedSessionTranscriptFileName filter to align
the counter with the indexer. The function is already exported from the
plugin SDK at memory-core-host-engine-qmd.
Contributor
Author
|
Closing due to cancelled CI |
This was referenced Jun 18, 2026
Closed
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(memory): align session file counter denominator with indexer filter
The
scanSessionFilesfunction inextensions/memory-core/src/cli.runtime.tscounts session transcript files usingentry.name.endsWith(".jsonl"), but the session indexer atsrc/infra/session-cost-usage.ts:386usesisUsageCountedSessionTranscriptFileName()which excludes non-session.jsonlfiles (trajectory artifacts, compaction checkpoints, archive backups).This mismatch inflates the
totalFilescount shown in the memory status CLI output, confusing operators who compare it against the actual indexed session count.What changed
isUsageCountedSessionTranscriptFileNamefrom the existing plugin SDK export atmemory-core-host-engine-qmd.endsWith(".jsonl")withisUsageCountedSessionTranscriptFileName(entry.name)in thescanSessionFilesfilterThe function is already used by the indexer at
src/infra/session-cost-usage.ts:386— this change aligns the counter with the same filter.Real behavior proof
node -eto callisUsageCountedSessionTranscriptFileNamewith test filenamesnode scripts/run-vitest.mjs run extensions/memory-core/src/— 63 test files, 934 tests passedpnpm build— built successfully in 79.6s.jsonlfiles (trajectory, checkpoints, archives) are excluded from the count.