session.reset daily mode: freshness check skipped on several post-boundary messages, reset fires mid-conversation · Issue #140053 · openclaw/openclaw · GitHub
Skip to content

session.reset daily mode: freshness check skipped on several post-boundary messages, reset fires mid-conversation #140053

Description

@laurencebrown

Version: 2026.9.1 (ad6fe23), macOS arm64, node 26.7.0

Config:

"session": { "reset": { "mode": "daily", "idleMinutes": 600, "atHour": 4 } }

Summary: Per dist/reset-policy-*.js, daily-mode staleness is staleDaily = sessionStartedAt < dailyResetAt, evaluated lazily — so a session started before the 4am boundary should reset on the FIRST inbound message after the boundary. Observed instead: three consecutive webchat (dashboard) messages after the boundary were handled normally in the stale session, and the reset then fired on the FOURTH message — mid-conversation from the user's perspective, discarding the context of the exchange that had just resumed.

Timeline (2026-09-06, Europe/Zurich; long-running dashboard session, last prior activity 2026-09-05 20:27):

  • 10:58, 11:06, 11:10 — three user messages handled normally in the old session. All are past both the 4am daily boundary and the 10h idleMinutes threshold; per the policy source, every one of them should have been the reset trigger.
  • 11:13:10.877 — transcript event {"type":"reset","reason":"daily"} written, 100ms before the user's fourth message is appended: that message triggered it.

Transcript excerpt (session store transcript_events):

seq 2018  2026-09-06T08:58:48Z  user      (handled in old session)
seq 2020  2026-09-06T09:06:10Z  user      (handled in old session)
seq 2022  2026-09-06T09:10:12Z  user      (handled in old session)
seq 2024  2026-09-06T09:13:10.877Z  {"type":"reset","reason":"daily",...}
seq 2025  2026-09-06T09:13:10.977Z  user

Expected: either the first post-boundary message resets the session (current policy semantics), or none of them do — resetting on the Nth message mid-conversation is the worst of both. It suggests some webchat dispatch path handles inbound messages without running the freshness evaluation (evaluateSessionFreshness / resolveSessionEntryResetFreshness), and a different path (hit on the fourth message) does run it. Repeated chat.startup calls from client reconnects were interleaved in the same window (11:03, 11:05, 11:08) if that helps narrow which path skips the check.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions