Bug Description
memoryFlush.enabled: true. Compaction fires reliably at the token threshold, but the configured flush turn does not write any content to memory/YYYY-MM-DD.md. Daily memory file remains empty after compaction.
This occurs whether or not memoryFlush.prompt is explicitly configured — the issue reproduces with the built-in default prompt and with an explicitly configured prompt.
Environment
- Channel: Telegram
- OpenClaw: 2026.4.15
Configuration (tried both ways)
Without explicit prompt (using built-in default):
"compaction": {
"mode": "safeguard",
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 8000
}
}
Built-in default prompt: "Write any lasting notes to memory/YYYY-MM-DD.md; reply with the exact silent token NO_REPLY if nothing to store."
With explicit prompt:
"compaction": {
"mode": "safeguard",
"keepRecentTokens": 30000,
"reserveTokensFloor": 30000,
"maxHistoryShare": 0.8,
"memoryFlush": {
"enabled": true,
"softThresholdTokens": 8000,
"prompt": "We are nearing a context limit. Summarize our progress today into memory/YYYY-MM-DD.md. If the file already exists, APPEND new content only."
}
}
Expected flush trigger: 162,000 tokens (safeguard floor 170k − softThreshold 8k).
Steps to Reproduce
- Continue a conversation until compaction fires (~170k tokens out of 200k)
- Observe: compaction message appears in chat ("🧹 Compacting context (636 messages)...")
- Check
memory/YYYY-MM-DD.md — no new entry written
- Repeat after gateway restart — same result
Compaction fires correctly at the expected threshold. The issue is specifically that the memory-flush turn does not write to disk.
Expected Behavior
When compaction fires, the silent memory-flush turn should write a summary to memory/YYYY-MM-DD.md before the transcript is compacted.
Relevant Log Extract
16:14:00+00:00 <compaction fires — context ~148k tokens, 72% of 200k, 636 messages>
[Compaction message visible in Telegram: "🧹 Compacting context (636 messages) so I can continue without losing history…"]
[memory/YYYY-MM-DD.md — no new entry, file modified timestamp unchanged since earlier]
File modified timestamps confirm no write occurred to daily memory file during compaction. No error messages appear in logs — the flush silently fails.
Additional Context
- Daily memory writes work correctly when triggered manually (e.g., via heartbeat)
- The issue is specific to the automatic flush on compaction
- Workspace is read-write; no
workspaceAccess restrictions in effect
Bug Description
memoryFlush.enabled: true. Compaction fires reliably at the token threshold, but the configured flush turn does not write any content tomemory/YYYY-MM-DD.md. Daily memory file remains empty after compaction.This occurs whether or not
memoryFlush.promptis explicitly configured — the issue reproduces with the built-in default prompt and with an explicitly configured prompt.Environment
Configuration (tried both ways)
Without explicit prompt (using built-in default):
Built-in default prompt:
"Write any lasting notes to memory/YYYY-MM-DD.md; reply with the exact silent token NO_REPLY if nothing to store."With explicit prompt:
Expected flush trigger: 162,000 tokens (safeguard floor 170k − softThreshold 8k).
Steps to Reproduce
memory/YYYY-MM-DD.md— no new entry writtenCompaction fires correctly at the expected threshold. The issue is specifically that the memory-flush turn does not write to disk.
Expected Behavior
When compaction fires, the silent memory-flush turn should write a summary to
memory/YYYY-MM-DD.mdbefore the transcript is compacted.Relevant Log Extract
File modified timestamps confirm no write occurred to daily memory file during compaction. No error messages appear in logs — the flush silently fails.
Additional Context
workspaceAccessrestrictions in effect