-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Dreaming: spawned sessions not cleaned up after Gateway restart #78458
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, 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.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, 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.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
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
deleteSessionafter 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
deleteSessioncalls were lost when the Gateway process was killed.Environment
sessions_spawnwith a child sessionSuggested 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
deleteSessioncalls).Workaround
Manual cleanup from the Control UI or
openclaw sessionsCLI./cc @steipete