Description
listSessionFilesForAgent() in query-expansion-*.js filters session files with .endsWith(".jsonl"), which excludes reset and deleted session transcripts that have suffixes like .jsonl.reset.<timestamp> and .jsonl.deleted.<timestamp>.
This means memory_search over session transcripts only returns results from active sessions. On a setup with daily resets, most conversation history becomes unsearchable immediately after reset.
Reproduction
- Configure
memory.qmd.sessions.enabled: true
- Use daily session resets (
session.reset.mode: "daily")
- After a few days, check the QMD sessions export directory vs the actual sessions directory:
# Files on disk (includes .reset and .deleted)
ls ~/.openclaw/agents/main/sessions/*.jsonl* | wc -l
# 39
# Files indexed by QMD (only .jsonl)
ls ~/.openclaw/agents/main/qmd/sessions/*.md | wc -l
# 12
Root cause
query-expansion-*.js line ~257:
async function listSessionFilesForAgent(agentId) {
const dir = resolveSessionTranscriptsDirForAgent(agentId);
try {
return (await fs.readdir(dir, { withFileTypes: true }))
.filter((entry) => entry.isFile())
.map((entry) => entry.name)
.filter((name) => name.endsWith(".jsonl")) // <-- excludes .jsonl.reset.* and .jsonl.deleted.*
.map((name) => path.join(dir, name));
} catch { return []; }
}
Expected behavior
Reset (and optionally deleted) session transcripts should be indexed by QMD and searchable via memory_search. These contain the bulk of conversation history on any setup using daily resets.
A possible fix: change the filter to match any filename containing .jsonl (e.g. /\.jsonl/ test instead of .endsWith(".jsonl")), or add a config option like memory.qmd.sessions.includeArchived: true.
resetArchiveRetention already controls how long these files live on disk, so QMD retention would naturally follow.
Environment
- OpenClaw version: latest (installed via npm)
- Node: v25.6.1
- OS: Linux (Hetzner VPS)
- QMD backend: external (
memory.qmd.mcporter)
- Session reset mode: daily
Description
listSessionFilesForAgent()inquery-expansion-*.jsfilters session files with.endsWith(".jsonl"), which excludes reset and deleted session transcripts that have suffixes like.jsonl.reset.<timestamp>and.jsonl.deleted.<timestamp>.This means
memory_searchover session transcripts only returns results from active sessions. On a setup with daily resets, most conversation history becomes unsearchable immediately after reset.Reproduction
memory.qmd.sessions.enabled: truesession.reset.mode: "daily")Root cause
query-expansion-*.jsline ~257:Expected behavior
Reset (and optionally deleted) session transcripts should be indexed by QMD and searchable via
memory_search. These contain the bulk of conversation history on any setup using daily resets.A possible fix: change the filter to match any filename containing
.jsonl(e.g./\.jsonl/test instead of.endsWith(".jsonl")), or add a config option likememory.qmd.sessions.includeArchived: true.resetArchiveRetentionalready controls how long these files live on disk, so QMD retention would naturally follow.Environment
memory.qmd.mcporter)