Skip to content

[Bug]: Session stuck in permanent busy state after mid-turn gateway restart — no auto-recovery, only /new or /reset clears it #92519

Description

@djmac17

Bug type

Crash (process/app exits or hangs)

Summary

When a gateway restart (launchctl kickstart, crash, manual /restart, or config-triggered restart) interrupts a mid-turn LLM completion, the session enters "busy" state and never recovers. No new messages are processed. Only /new or /reset clears it.

Repro Steps

  1. Session is mid-turn (LLM completion in flight)
  2. Gateway restarts for any reason
  3. Gateway comes back up
  4. Session is stuck in "busy" — no messages processed, no timeout, no auto-clear

Expected Behavior

On gateway startup, sessions with no active LLM completion should have their busy flag cleared. The gateway should detect orphaned busy states (completion PID/promise no longer exists) and auto-recover within a reasonable timeout (e.g., 30 seconds).

Actual Behavior

Session stays busy indefinitely. The assemble() function continues to fire (301 calls observed over a 12-hour span) but dispatches zero LLM completions. The session is effectively dead until the user manually runs /new or /reset.

Evidence

  • Observed twice on June 12, 2026 (05:29 UTC and 17:20 UTC) on a Mac mini running OpenClaw with Telegram channel
  • 301 assemble() calls with 0 LLM dispatches across a 12-hour window
  • Gateway restart was caused by config change (launchctl kickstart)

Related Issues

Environment

  • OpenClaw 2026.4.15
  • macOS, Telegram channel
  • Single-agent config, PCM compaction extension loaded

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions