#How to prevent 4am session reset
1 messages · Page 1 of 1 (latest)
I’m checking the docs and source because 4am is suspiciously specific.
Yes. On current OpenClaw builds, 4:00 AM local time on the gateway host is the default daily session reset.
A couple important details:
- It usually does not hard-reset exactly at 4am.
- The next message after 4am gets a fresh
sessionId.
If you want to stop the daily reset, switch session reset from daily to idle, for example:
{
session: {
reset: {
mode: "idle",
idleMinutes: 10080, // 7 days
},
},
}
Or only for Discord:
{
session: {
resetByChannel: {
discord: { mode: "idle", idleMinutes: 10080 },
},
},
}
Then restart the gateway.
Also, memory.md is durable workspace context, but it is not the same as keeping the old chat transcript alive. So if your log-checking flow depends on prior chat history, a session reset will still break that. In that case, put the resume logic in BOOTSTRAP.md or write structured checkpoints into memory/.
Docs:
- https://docs.openclaw.ai/concepts/session
- https://docs.openclaw.ai/gateway/configuration-reference
- https://docs.openclaw.ai/help/faq
Can you paste openclaw --version? I want to make sure this matches your build exactly.
OpenClaw 2026.4.14 (323493f)
Yep, 2026.4.14 supports this config.
For your case, I’d probably use resetByType.thread so Discord threads stop doing the 4am rollover, without changing everything else:
{
session: {
resetByType: {
thread: {
mode: "idle",
idleMinutes: 10080, // 7 days
},
},
},
}
If you want to change it for all sessions, use:
{
session: {
reset: {
mode: "idle",
idleMinutes: 10080,
},
},
}
Then restart the gateway:
openclaw gateway restart
One important catch: I don’t see a documented “never reset at all” mode right now. Supported modes are basically daily and idle, so the practical fix is using a long idle window.
Also, if your memory.md flow is meant to survive fresh sessions, it should persist important state into files and re-read them on startup. A reset will always break anything that depends on prior chat transcript still being in-context.
Docs:
If you want, paste your current session: block and I’ll rewrite it for exactly this behavior.
},
"session": {
"dmScope": "per-channel-peer"
},
Yep, that current block only changes DM isolation. It does not affect the 4am thread reset.
If you want to keep your current DM behavior and stop the daily reset for threads, make it:
{
session: {
dmScope: "per-channel-peer",
resetByType: {
thread: {
mode: "idle",
idleMinutes: 10080, // 7 days
},
},
},
}
If you want everything to stop resetting daily, use this instead:
{
session: {
dmScope: "per-channel-peer",
reset: {
mode: "idle",
idleMinutes: 10080,
},
},
}
Then run: