-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: memory status reports dirty=false for unindexed usage-counted session transcripts (false-clean status path) #97814
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automationExclude from stale automation
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automationExclude from stale automation
Type
Fields
Priority
None yet
Summary
openclaw memory status(plain, without--index) can reportdirty=falsewhile a newly created usage-counted session transcript exists on disk with zero rows in bothmemory_index_sourcesandmemory_index_chunks. This is a false-clean state: the operator sees no backlog, but memory search silently misses the unindexed transcript.Reproduction
Reproduced 2026-06-29 on OpenClaw 2026.6.5 with agent
archer:openclaw memory statusreporteddirty=false.1762while indexable session files on disk were1763.sessions/archer/1d5782de-a41a-4931-8519-fd4b15940947.jsonl— a normal live session transcript, not a checkpoint/trajectory artifact.memory_index_sourcesandmemory_index_chunks.openclaw memory status --agent archer --index --jsonrepaired it immediately:1762 → 17631813 → 18146898 → 6905Root Cause
The status-mode
MemoryManagerinitialization path skipsensureSessionStartupCatchup():purpose === "status", the manager init does not callensureSessionStartupCatchup().status()reports persisted dirty flags only:dirty || sessionsDirty || indexIdentityDirty.markSessionStartupCatchupDirtyFiles()whenreason === "cli"before sync.This means any session transcript created after the last CLI sync that hasn't been caught by a non-transient manager cycle will be invisible to plain
memory status.PR #82341 (fixes #62625) added the startup catch-up scan for normal manager startup, but the status-purpose initialization path still bypasses it. The gap is specifically in the status code path, not the indexing code path.
Affected Source Areas
Based on compiled artifact inspection of 2026.6.5:
extensions/memory-core/src/memory/manager.ts— manager initialization branches onpurposeextensions/memory-core/src/memory/manager-sync-ops.ts—ensureSessionStartupCatchup()andmarkSessionStartupCatchupDirtyFiles()extensions/memory-core/src/cli.runtime.ts— CLI status path initializationProposed Fix
Two design options:
Option A (preferred): Run the same lightweight
ensureSessionStartupCatchup()detection in status mode, or a cheaper variant that surfaces effective dirtiness without performing a full sync. The status path would then reportdirty=truewhen on-disk session files have no correspondingmemory_index_sourcesrows, even if no in-process dirty flag is set.Option B: Compute a session-surface drift signal explicitly in the status path — compare the canonical session file list against
memory_index_sourcesrows for sourcesessions— and reporteffectiveDirtyor similar without mutating state.Either approach avoids making
statusheavy (no full reindex) while removing the false-clean reporting gap. The key requirement is that plainopenclaw memory statusmust not claimdirty=falsewhen unindexed usage-counted transcripts exist.Why Current Status Is Misleading
openclaw memory statusas the primary health check for memory recall.dirty=falsesignal means operators will not know session transcripts are unindexed.--indexor--forcetriggers the catch-up path.Environment