openclaw - 💡(How to fix) Fix Dreaming: spawned sessions not cleaned up after Gateway 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#78458Fetched 2026-05-07 03:36:45
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Author
Timeline (top)
commented ×1mentioned ×1subscribed ×1

When Gateway restarts during a Dreaming cycle, the spawned child sessions (light/REM/deep phases) are not cleaned up and remain visible in the Control UI sidebar.

Root Cause

When Gateway restarts during a Dreaming cycle, the spawned child sessions (light/REM/deep phases) are not cleaned up and remain visible in the Control UI sidebar.

Fix Action

Workaround

Manual cleanup from the Control UI or openclaw sessions CLI.

/cc @steipete

RAW_BUFFERClick to expand / collapse

Description

When Gateway restarts during a Dreaming cycle, the spawned child sessions (light/REM/deep phases) are not cleaned up and remain visible in the Control UI sidebar.

Expected Behavior

Dreaming calls deleteSession after each phase completes. These sessions should not persist across Gateway restarts.

Observed Behavior

After a Gateway restart during Dreaming, residual child sessions remain in the sidebar (6 orphaned sessions observed). They appear to be from phases that completed their work but whose cleanup deleteSession calls were lost when the Gateway process was killed.

Environment

  • OpenClaw: 2026.5.4
  • macOS (arm64)
  • Dreaming schedule: daily 00:30 (light → REM → deep)
  • Each phase uses sessions_spawn with a child session

Suggested Fix

On Gateway startup, consider scanning for orphaned Dreaming child sessions (e.g., sessions spawned by Dreaming that have already completed) and cleaning them up. Alternatively, use a more durable cleanup mechanism (e.g., mark sessions for deletion in a persistent store rather than relying on in-process deleteSession calls).

Workaround

Manual cleanup from the Control UI or openclaw sessions CLI.

/cc @steipete

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…

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 Dreaming: spawned sessions not cleaned up after Gateway restart [1 comments, 2 participants]