openclaw - 💡(How to fix) Fix [Bug]: Bug Report: 80 Sessions Keep Recreating After Restart [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#75954Fetched 2026-05-03 04:43:58
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Author
Timeline (top)
labeled ×2commented ×1

Environment OpenClaw: 2026.4.29 Node: v22.22.2 Platform: macOS 25.4.0 (arm64) Gateway: Running via LaunchAgent (pid changes on restart) Problem After restarting the gateway multiple times, the session count stays at 80 active sessions. The sessions persist even after:

Root Cause

Environment OpenClaw: 2026.4.29 Node: v22.22.2 Platform: macOS 25.4.0 (arm64) Gateway: Running via LaunchAgent (pid changes on restart) Problem After restarting the gateway multiple times, the session count stays at 80 active sessions. The sessions persist even after:

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Environment OpenClaw: 2026.4.29 Node: v22.22.2 Platform: macOS 25.4.0 (arm64) Gateway: Running via LaunchAgent (pid changes on restart) Problem After restarting the gateway multiple times, the session count stays at 80 active sessions. The sessions persist even after:

Steps to reproduce

Gateway restart (openclaw gateway restart) Session cleanup (openclaw sessions cleanup --all-agents --enforce) Deleting old session files from disk Observed Behavior After restart, openclaw status shows 80 active sessions CPU stays at 50-100% due to constant processing sessions.list takes 4-12 seconds per operation node.list takes 4-21 seconds per operation Event loop gets saturated, causing liveness warnings Logs Excerpt Copy liveness warning: reasons=event_loop_delay interval=30s eventLoopDelayP99Ms=4244 eventLoopDelayMaxMs=12440 eventLoopUtilization=0.888 sessions.list: 4000-12000ms per operation What We Tried Gateway restart (multiple times) Session cleanup command Deleting old .jsonl and .trajectory files from /agents/*/sessions/ Disabled Discord and Telegram channels Checked cron jobs (not causing the issue)

Expected behavior

After gateway restart, session count should reset to a low number (e.g., 0-10) instead of staying at 80.

Actual behavior

Session-memory plugin not clearing between restarts Sessions being recreated from persisted state incorrectly Memory leak in session handling

OpenClaw version

2026.4.29

Operating system

MacOS

Install method

No response

Model

synthethic

Provider / routing chain

openclaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be mitigated by investigating and addressing the root cause of the session-memory plugin not clearing between restarts, potentially due to incorrect persisted state recreation or memory leaks in session handling.

Guidance

  • Investigate the session-memory plugin's behavior and configuration to understand why it's not clearing sessions between restarts.
  • Review the code responsible for recreating sessions from persisted state to ensure it's correctly handling session cleanup.
  • Check for any memory leaks in session handling by monitoring memory usage and analyzing logs for patterns indicating memory issues.
  • Consider temporarily disabling the session-memory plugin or implementing a workaround to clear sessions manually until a permanent fix is found.

Example

No code snippet is provided as the issue lacks specific details about the codebase.

Notes

The provided information suggests a potential issue with the session-memory plugin or session handling, but without more details about the code or configuration, it's difficult to provide a precise solution.

Recommendation

Apply workaround: Implement a temporary manual session cleanup process or disable the session-memory plugin until the root cause is identified and addressed, as this will help mitigate the issue and prevent further performance degradation.

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

After gateway restart, session count should reset to a low number (e.g., 0-10) instead of staying at 80.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Bug Report: 80 Sessions Keep Recreating After Restart [1 comments, 2 participants]