Skip to content

Session lock stuck in 'processing' after context overflow compaction succeeds #70334

@houstontruong

Description

@houstontruong

Bug

After context overflow auto-compaction succeeds and the prompt is retried, the session remains stuck in processing state indefinitely with queueDepth=0. This blocks ALL incoming messages across all channels until a gateway restart.

Environment

  • OpenClaw 2026.4.21 (f788c88)
  • Model: openai-codex/gpt-5.4
  • Compaction mode: safeguard
  • Context pruning: cache-ttl, 1h TTL

Reproduction

  1. Long-running session (~185-399 messages) hits context overflow
  2. Auto-compaction triggers and succeeds
  3. Log shows: auto-compaction succeeded for openai-codex/gpt-5.4; retrying prompt
  4. Session stays in processing state forever
  5. Diagnostics flag: stuck session: sessionId=main state=processing age=Xs queueDepth=0

Logs

20:07:56.630Z warn agent/embedded context overflow detected (attempt 1/3); attempting auto-compaction for openai-codex/gpt-5.4
20:12:50.808Z info agent/embedded auto-compaction succeeded for openai-codex/gpt-5.4; retrying prompt
20:15:20.872Z warn diagnostic stuck session: sessionId=main sessionKey=agent:…6191 state=processing age=149s queueDepth=0
(stuck for 5+ minutes, never recovered)

Impact

  • All channels stop receiving responses (single session blocks everything)
  • Only fixable by gateway restart
  • Happened twice in 30 minutes on same session

Expected

After compaction succeeds and prompt retries, the session should return to idle state after the retry completes (success or error).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.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: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions