#Context lost the next day
1 messages · Page 1 of 1 (latest)
This is usually the session reset policy, not Telegram topic routing itself.
Current OpenClaw defaults reset sessions daily around 4am local time unless you override it. For Telegram topics that feels exactly like “it forgot what we talked about yesterday”.
Try setting a longer Telegram session reset window in ~/.openclaw/openclaw.json / JSON5:
{
session: {
resetByChannel: {
telegram: {
mode: "idle",
idleMinutes: 10080, // 7 days; use 43200 for 30 days
},
},
},
}
Then restart the gateway:
openclaw gateway restart
If you want this only for group/forum topics and not Telegram DMs, use type-specific policy instead:
{
session: {
resetByType: {
thread: { mode: "idle", idleMinutes: 10080 },
group: { mode: "idle", idleMinutes: 10080 },
},
},
}
Also please check your version with:
openclaw --version
If it still loses context after that, paste openclaw status --all and we can check whether the topic is getting a stable session key like telegram:group:<chatId>:topic:<topicId>.
Docs: https://docs.openclaw.ai/gateway/config-agents#session and https://docs.openclaw.ai/channels/telegram#forum-topics-and-thread-behavior
how do I set this globally?
Set the top-level session.reset policy. That becomes the default for all channels/session types unless session.resetByChannel or session.resetByType overrides it.
In ~/.openclaw/openclaw.json:
{
session: {
reset: {
mode: "idle",
idleMinutes: 10080, // 7 days
// 43200 = 30 days
},
},
}
Then restart:
openclaw gateway restart
If you already have session.resetByChannel or session.resetByType, those can still override the global default, so remove/update them too.
For long retention, I’d also keep maintenance at least as long as your desired memory window:
{
session: {
reset: { mode: "idle", idleMinutes: 43200 },
maintenance: {
pruneAfter: "60d",
},
},