Feature Request: Configurable Session History Retention
Problem
OpenClaw currently compacts session history within 24 hours with no way to configure retention policy. This causes critical context loss when troubleshooting issues or reviewing past work.
Use Case
User experienced a comprehensive .env key scan that ran for 8+ hours on Feb 7, mentioned in every heartbeat. By Feb 8 at 4:03 AM, all session history from Feb 7 was compacted and lost. No way to verify what ran, retrieve results, or debug the issue.
Requested Feature
Add configurable session history retention policies:
{
"session": {
"history": {
"retentionDays": 7, // Keep detailed history for 7 days
"summaryRetentionDays": 30, // Keep high-level summaries 7-30 days
"archiveAfterDays": 30, // Archive (compress/export) after 30 days
"autoExport": {
"enabled": true,
"path": "~/.openclaw/session-archives/",
"format": "jsonl" // or "markdown"
}
}
}
}
Benefits
- Troubleshooting - Review what happened when issues occur
- Audit trail - Track long-running operations and their results
- Memory - AI agents can reference past work without re-running
- Recovery - Restore context after crashes or restarts
Current Workaround
None effective. Memory files help but don't capture full session context.
Priority
High - This is a blocker for production use where accountability and audit trails matter.
Related
- Current
compaction settings only control in-session summarization
memory_search helps but doesn't preserve full session transcripts
Feature Request: Configurable Session History Retention
Problem
OpenClaw currently compacts session history within 24 hours with no way to configure retention policy. This causes critical context loss when troubleshooting issues or reviewing past work.
Use Case
User experienced a comprehensive .env key scan that ran for 8+ hours on Feb 7, mentioned in every heartbeat. By Feb 8 at 4:03 AM, all session history from Feb 7 was compacted and lost. No way to verify what ran, retrieve results, or debug the issue.
Requested Feature
Add configurable session history retention policies:
{ "session": { "history": { "retentionDays": 7, // Keep detailed history for 7 days "summaryRetentionDays": 30, // Keep high-level summaries 7-30 days "archiveAfterDays": 30, // Archive (compress/export) after 30 days "autoExport": { "enabled": true, "path": "~/.openclaw/session-archives/", "format": "jsonl" // or "markdown" } } } }Benefits
Current Workaround
None effective. Memory files help but don't capture full session context.
Priority
High - This is a blocker for production use where accountability and audit trails matter.
Related
compactionsettings only control in-session summarizationmemory_searchhelps but doesn't preserve full session transcripts