Skip to content

[Bug]: Group/channel sessions never reset daily (updatedAt bumped before freshness check) #21161

Description

@marijnvdwerf

Summary

Group/channel sessions (e.g. Discord channels) never reset at the daily 4am boundary under the default config (session: null). Main sessions may still reset (especially when heartbeats are enabled), but group/channel sessions persist for many days.

Steps to reproduce

  1. Use default session config (session: null).
  2. Send messages in a group/channel session (e.g. Discord channel).
  3. Wait past the daily reset boundary (4am).
  4. Send an inbound message after 4am.

Expected behavior

A new session is created after the daily reset boundary.

Actual behavior

The same session ID persists across the reset boundary. Group/channel sessions can persist for days.

OpenClaw version

2026.2.15

Operating system

macOS 15.6.1 (arm64)

Install method

npm global

Logs, screenshots, and evidence

None included yet.

Impact and severity

Affected: group/channel sessions (Discord channels observed).
Severity: Medium (stale context never resets as expected).
Frequency: Always.
Consequence: Unexpected long-lived context; daily reset policy ineffective.

Additional information

Related to #11520 (idle reset blocked by updatedAt bump). This appears to block daily reset for group/channel sessions as well.

Suspected root cause:

  • recordInboundSession calls recordSessionMetaFromInbound before reply dispatch: src/channels/session.ts
  • mergeSessionEntry always sets updatedAt = Math.max(..., Date.now()): src/config/sessions/types.ts
  • Freshness check uses entry.updatedAt: src/auto-reply/reply/session.ts

This makes daily reset checks compare "now" against the reset boundary, which is always fresh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions