Skip to content

Session transcript indexing skipped on CLI cold start (sessionsDirty never initialized) #6600

@jiahknee5

Description

@jiahknee5

Bug

clawdbot memory index --agent <id> successfully indexes memory files but silently skips session transcripts (0 indexed), even when sources: ["memory", "sessions"] and experimental.sessionMemory: true are configured, and JSONL session files exist.

Root Cause

In manager.js, the constructor initializes the memory dirty flag but not the sessions dirty flag:

// line 144 — memory gets marked dirty on construction
this.dirty = this.sources.has("memory");

// sessionsDirty is never initialized — stays false

The sync decision in shouldSyncSessions() (line 754) falls through to:

return this.sessionsDirty && this.sessionsDirtyFiles.size > 0;

Since sessionsDirty is false on a fresh CLI invocation (no runtime file watchers running), session sync is always skipped. Memory files work because this.dirty starts as true.

Expected Behavior

clawdbot memory index should index both memory files and session transcripts when both sources are configured.

Suggested Fix

Initialize this.sessionsDirty in the constructor, matching the existing memory pattern:

this.dirty = this.sources.has("memory");
this.sessionsDirty = this.sources.has("sessions");  // add this

This ensures the first sync always picks up sessions, whether triggered from CLI or runtime.

Environment

  • Version: 2026.1.24-3 (npm)
  • Provider: local (BGE-base GGUF, Metal GPU)
  • OS: macOS (Apple Silicon)

Repro

clawdbot memory index --agent venture --verbose
# Output: [memory] sync runs, [sessions] sync never triggers
# Result: 33/33 memory files indexed, 0/10 session files indexed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions