openclaw - 💡(How to fix) Fix [Bug]: Unexpected sessionFile reset behavior [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70320Fetched 2026-04-23 07:26:20
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×2closed ×1commented ×1

Session resets do not result in a new sessionFile every reset period - sessionId resets, but sessionFile gets set, which is then persisted across every reset going forward.

Root Cause

  • The primary pain point is around QMD. It appears to trip up more on long, constantly-updated session files than on smaller, stable ones.
  • Direct observation showed that removing sessionFile causes OpenClaw to regenerate the correct default path on the next message.
  • This suggests the problem is not transcript creation itself, but over-preservation of an old explicit sessionFile across resets.
  • This matters because smaller session docs are easier to inspect and work with.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Session resets do not result in a new sessionFile every reset period - sessionId resets, but sessionFile gets set, which is then persisted across every reset going forward.

Steps to reproduce

  1. Use a direct-chat session routed to agent:main:main.
  2. Confirm session.resetByType.direct = { mode: "daily", atHour: 10 } is active.
  3. Let the session have an explicit sessionFile in sessions.json.
  4. Let a reset boundary pass, or inspect a session after reset.
  5. Observe that sessionId changes but sessionFile still points to the old transcript path.
  6. Remove sessionFile from agent:main:main in sessions.json.
  7. Send one new message.
  8. Observe that OpenClaw regenerates sessionFile as /data/agents/main/sessions/<current-sessionId>.jsonl.

Expected behavior

When a reset rotates sessionId, transcript path should roll too. The active transcript file should follow the current sessionId.

Actual behavior

sessionId rotates, but an already-persisted sessionFile is preserved across resets. This keeps writing into an older transcript file until sessionFile is manually removed.

OpenClaw version

2026.4.15

Operating system

Linux 6.12.47-fly (x64)

Install method

docker

Model

gpt 5.4

Provider / routing chain

openclaw -> codex -> openai

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

  • Affected users/systems/channels: Direct-chat sessions using stable session keys like agent:main:main, especially when transcript shape matters for downstream tooling.
  • Severity: Annoying to moderate. Confusing session behavior, breaks expectation that reset implies fresh transcript file.
  • Frequency: Deterministic once sessionFile is explicitly persisted and then preserved across resets.
  • Consequence: Harder debugging, larger long-lived transcript docs, worse transcript hygiene for exports/indexing, possible extra QMD churn on long constantly-updated transcript files.

Additional information

  • The primary pain point is around QMD. It appears to trip up more on long, constantly-updated session files than on smaller, stable ones.
  • Direct observation showed that removing sessionFile causes OpenClaw to regenerate the correct default path on the next message.
  • This suggests the problem is not transcript creation itself, but over-preservation of an old explicit sessionFile across resets.
  • This matters because smaller session docs are easier to inspect and work with.

extent analysis

TL;DR

Remove the explicitly persisted sessionFile from sessions.json to allow OpenClaw to regenerate the correct default path on the next message.

Guidance

  • Verify that the issue is caused by the preservation of an old explicit sessionFile across resets by checking the sessions.json file for the presence of sessionFile and its value.
  • Remove the sessionFile from sessions.json to trigger OpenClaw to regenerate the correct default path on the next message.
  • Confirm that the new sessionFile path follows the current sessionId after a reset.
  • Consider implementing a mechanism to automatically remove or update the sessionFile on each reset to prevent this issue from occurring in the future.

Example

No code snippet is provided as the issue does not require a code change, but rather a configuration update.

Notes

The provided solution assumes that the issue is caused by the preservation of an old explicit sessionFile across resets. If the issue persists after removing the sessionFile, further investigation may be required.

Recommendation

Apply the workaround by removing the explicitly persisted sessionFile from sessions.json to allow OpenClaw to regenerate the correct default path on the next message. This is recommended because it directly addresses the root cause of the issue and allows for a straightforward solution without requiring code changes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When a reset rotates sessionId, transcript path should roll too. The active transcript file should follow the current sessionId.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING