#AI loses session context on new Discord DM sessions and after midnight — expected behavior or bug?

1 messages · Page 1 of 1 (latest)

timber garden
#

Running: OpenClaw 2026.5.12, model deepseek/deepseek-v4-flash, Discord DM channel.

Three issues I'm trying to understand:

Fresh sessions have zero history.

Every time a new Discord DM session starts (e.g., the next day), the AI sees an empty inbox — sessions_history returns empty, no prior messages from that channel are visible. The session transcripts do exist on disk (sessions/*.jsonl) but aren't accessible to the AI unless they've been manually saved to memory files. Is there a way to surface previous session history from the same channel?

memory_search corpus=sessions doesn't find old conversations.

Even with corpus=sessions, the semantic search against old session transcripts comes up empty for topics the user knows were discussed. Is there a lag in indexing, or a cleanup TTL for session transcript chunks? How long do session transcripts stay in the search index?

Sometimes, while actively chatting past midnight, the AI suddenly loses all context of the current conversation — it forgets what was discussed minutes earlier. This seems to happen when a calendar date rolls over. Is there a daily session reset or compaction that triggers at midnight ET that could clear the active context?

Trying to understand whether I need to rely purely on manual memory/ files or if there's a way to make session continuity work better. Thanks!

modern haloBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

lone horizonBOT
# timber garden Running: OpenClaw 2026.5.12, model deepseek/deepseek-v4-flash, Discord DM channe...

This is mostly expected behavior from the current session model, with one part worth filing if it’s sharper than the docs imply.

What I found in the docs/source:

  • OpenClaw has a default daily session reset at 4:00 AM in the gateway host’s local timezone. If your gateway is running in UTC, that is midnight Eastern during daylight time, which matches your “after midnight ET” symptom. New messages after that reset point can be routed into a fresh session, so the live model context starts clean.
  • Session transcripts are persisted on disk, but a new session does not automatically get the prior transcript injected into the prompt. sessions_history reads a specific visible session; it is not “all prior messages from this Discord DM.”
  • Session tools are visibility-scoped. The default is tree (current session + spawned child sessions), so a new daily DM session may not be able to see older sibling sessions unless you opt into wider visibility:
{
  tools: {
    sessions: {
      visibility: "agent"
    }
  }
}

Use "all" only if you really want cross-agent/session visibility.

lone horizonBOT
lone horizonBOT
# timber garden Running: OpenClaw 2026.5.12, model deepseek/deepseek-v4-flash, Discord DM channe...
openclaw memory index --force

The docs note session indexing is async and can be slightly stale. The default source list is only ["memory"], so empty corpus=sessions results are expected unless that opt-in is present.

If you want fewer “fresh brain tomorrow” moments, change the reset policy away from daily, for example:

{
  session: {
    reset: {
      mode: "idle",
      idleMinutes: 10080
    }
  }
}

That makes resets inactivity-based instead of daily.