Memory Compaction Bug Report
Bug Description
Memory compaction (memory flush) feature is never triggered even when the conversation context should be full.
Evidence
Session State
- Session ID: b03da55e-c8fe-43f3-b634-a6a29332edae
- Compaction Count:
0 (never executed)
- Session file:
/root/.openclaw/agents/main/sessions/b03da55e-c8fe-43f3-b634-a6a29332edae.jsonl
Reproduction Steps
- Start a long conversation session with multiple tool calls
- Continue conversation until context should be near full
- Observe that memory compaction never triggers
- Check
compactionCount in session state - remains at 0
Expected Behavior
- Memory compaction should automatically trigger when context reaches threshold
compactionCount should increment with each flush
- Durable memories should be saved to
memory/YYYY-MM-DD.md
Actual Behavior
- Memory compaction never triggers
compactionCount stays at 0 even after extensive conversation
- Manual memory save works, but automatic compaction fails
Configuration
Current Configuration
{
"memory": {
"backend": "local",
"local": {
"embeddingModel": "hf:ggml-org/embeddinggemma-300M-GGUF/embeddinggemma-300M-Q8_0.gguf"
}
},
"plugins": {
"entries": {
"memory-lancedb": {
"enabled": true
}
},
"slots": {
"memory": "memory-lancedb"
}
}
}
Memory Files
- Manual memory saves work:
memory/2026-02-11.md (96 lines)
- Total memory files: ~368 lines across multiple dates
- No automatic compaction observed
Environment
- Platform: Linux 5.15.0-164-generic (x64)
- Node: v22.22.0
- OpenClaw Version: 2026.2.9 (last touched 2026-02-10T07:12:15.055Z)
- Channel: Telegram
- Model: minimax/MiniMax-M2.1
Investigation Notes
- Memory Flush Trigger: The system message says "Pre-compaction memory flush" but it doesn't actually trigger compaction
- Manual Save Works: Using
memory/YYYY-MM-DD.md manually saves memories successfully
- No Error Messages: No visible errors when "Pre-compaction" triggers - just responds with NO_REPLY
- Compaction Timer: Unclear what threshold triggers automatic compaction
Suggested Investigation Areas
- Check if
compactionCount increment logic exists in codebase
- Verify trigger conditions for memory compaction
- Check if there's a configuration option to enable/disable compaction
- Look for any race conditions or errors preventing compaction
- Verify LanceDB plugin integration with memory compaction
Additional Context
The user manually saves important memories to memory/YYYY-MM-DD.md as per the prompt guidelines, but the automatic memory compaction feature appears to be non-functional.
Template Source
This report follows the OpenClaw guideline:
"If you find bugs, try to fix them first. If you can't fix them, create a detailed issue report."
However, without git access to the repository, this report is prepared for manual submission to:
Report Prepared: 2026-02-11 23:26 GMT+8
Reporter: OpenClaw User (via assistant)
Memory Compaction Bug Report
Bug Description
Memory compaction (memory flush) feature is never triggered even when the conversation context should be full.
Evidence
Session State
0(never executed)/root/.openclaw/agents/main/sessions/b03da55e-c8fe-43f3-b634-a6a29332edae.jsonlReproduction Steps
compactionCountin session state - remains at 0Expected Behavior
compactionCountshould increment with each flushmemory/YYYY-MM-DD.mdActual Behavior
compactionCountstays at 0 even after extensive conversationConfiguration
Current Configuration
{ "memory": { "backend": "local", "local": { "embeddingModel": "hf:ggml-org/embeddinggemma-300M-GGUF/embeddinggemma-300M-Q8_0.gguf" } }, "plugins": { "entries": { "memory-lancedb": { "enabled": true } }, "slots": { "memory": "memory-lancedb" } } }Memory Files
memory/2026-02-11.md(96 lines)Environment
Investigation Notes
memory/YYYY-MM-DD.mdmanually saves memories successfullySuggested Investigation Areas
compactionCountincrement logic exists in codebaseAdditional Context
The user manually saves important memories to
memory/YYYY-MM-DD.mdas per the prompt guidelines, but the automatic memory compaction feature appears to be non-functional.Template Source
This report follows the OpenClaw guideline:
However, without git access to the repository, this report is prepared for manual submission to:
Report Prepared: 2026-02-11 23:26 GMT+8
Reporter: OpenClaw User (via assistant)