openclaw - 💡(How to fix) Fix WebChat session history lost: `agent:main:main` pointer flips on every `openclaw.json` rewrite [1 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#74640Fetched 2026-04-30 06:21:44
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

When openclaw onboard --install-daemon, openclaw config ..., or any other command rewrites ~/.openclaw/openclaw.json, the active WebChat session pointer (agent:main:main) is swapped to a brand-new session. The new session has no access to the prior conversation, even though the underlying transcript JSONL is still on disk under ~/.claude/projects/<workspace>/<sessionId>.jsonl. From the user's seat in the browser, the chat suddenly forgets everything.

Root Cause

Possible root cause (speculation)

Fix Action

Workaround

Avoid running anything that rewrites openclaw.json during an active chat. Manually recover transcripts from ~/.claude/projects/<workspace>/<sessionId>.jsonl after the fact.

Code Example

2026-04-29T19:20:34Z  openclaw onboard --install-daemon
2026-04-29T19:22:03Z  openclaw onboard --install-daemon
2026-04-29T20:45:13Z  openclaw config
2026-04-29T20:45:20Z  openclaw config
2026-04-29T20:46:13Z  openclaw config
2026-04-29T20:47:46Z  openclaw config
RAW_BUFFERClick to expand / collapse

Summary

When openclaw onboard --install-daemon, openclaw config ..., or any other command rewrites ~/.openclaw/openclaw.json, the active WebChat session pointer (agent:main:main) is swapped to a brand-new session. The new session has no access to the prior conversation, even though the underlying transcript JSONL is still on disk under ~/.claude/projects/<workspace>/<sessionId>.jsonl. From the user's seat in the browser, the chat suddenly forgets everything.

Impact

  • In-progress WebChat conversations get cut off without warning.
  • The assistant in the new session has no idea a prior session existed unless it goes spelunking through ~/.claude/projects/....
  • Recovery is manual: scrape the orphaned .jsonl, re-summarize into memory.

Repro (observed twice on 2026-04-29)

Working in a WebChat session, the control UI ran commands that touched openclaw.json:

  1. openclaw onboard --install-daemon (15:20 EDT, 15:22 EDT)
  2. openclaw config ... writes (16:45-16:47 EDT, four times)

After each batch, the next WebChat message landed in a brand-new session with no memory of the prior thread. The pointer in agent:main:main had been swapped; the prior session's .jsonl was renamed with a .reset.<ts> suffix in some cases.

The same thing happened again the same afternoon: a session active 17:17-17:32 EDT was reset by 18:04 EDT after additional config writes.

Audit log evidence

~/.openclaw/logs/config-audit.jsonl records each rewrite of openclaw.json. Excerpt (UTC):

2026-04-29T19:20:34Z  openclaw onboard --install-daemon
2026-04-29T19:22:03Z  openclaw onboard --install-daemon
2026-04-29T20:45:13Z  openclaw config
2026-04-29T20:45:20Z  openclaw config
2026-04-29T20:46:13Z  openclaw config
2026-04-29T20:47:46Z  openclaw config

Each entry is followed shortly by a new session ID appearing in ~/.claude/projects/-Users-nispand--openclaw-workspace/.

Expected behavior

A config rewrite (especially one for plugin install, daemon install, or unrelated settings) should not invalidate the active session pointer. The current WebChat session should survive config writes.

Actual behavior

agent:main:main is reset to a fresh session and prior chat context disappears for the assistant - even though the user is still in the same browser tab.

Workaround

Avoid running anything that rewrites openclaw.json during an active chat. Manually recover transcripts from ~/.claude/projects/<workspace>/<sessionId>.jsonl after the fact.

Environment

  • OpenClaw 2026.4.26 (be8c246)
  • Node v24.0.0
  • macOS 13.0.1 (22A400), arm64
  • Channel: WebChat

Possible root cause (speculation)

Whatever code path persists openclaw.json appears to also re-initialize the agent runtime or its session registry, instead of treating session state as orthogonal to config state. The .reset.<ts> JSONL rename in particular suggests an explicit "reset session on config change" branch somewhere.

extent analysis

TL;DR

The issue can be mitigated by avoiding config rewrites during active chats or by implementing a session persistence mechanism that survives openclaw.json rewrites.

Guidance

  • Investigate the code path that rewrites openclaw.json to determine why it resets the agent:main:main session pointer.
  • Review the session registry implementation to see if it can be modified to treat session state as orthogonal to config state.
  • Consider adding a mechanism to persist session state separately from config state, allowing sessions to survive config rewrites.
  • Examine the .reset.<ts> JSONL rename behavior to understand its purpose and potential impact on session persistence.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The root cause of the issue is speculative and requires further investigation. The provided information suggests that the session reset is related to the openclaw.json rewrite, but the exact mechanism is unclear.

Recommendation

Apply a workaround by avoiding config rewrites during active chats until a more permanent solution can be implemented. This will prevent session resets and allow users to continue their conversations without interruption.

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

A config rewrite (especially one for plugin install, daemon install, or unrelated settings) should not invalidate the active session pointer. The current WebChat session should survive config writes.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING