openclaw - 💡(How to fix) Fix Session lock stuck in 'processing' after context overflow compaction succeeds [1 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#70334Fetched 2026-04-23 07:26:09
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Error Message

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)

Code Example

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)
RAW_BUFFERClick to expand / collapse

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).

extent analysis

TL;DR

The session remains stuck in the processing state after auto-compaction succeeds, suggesting a potential issue with the retry mechanism or session state management.

Guidance

  • Investigate the retry logic after auto-compaction to ensure it correctly updates the session state to idle upon completion.
  • Verify that the queueDepth=0 condition is properly handled to prevent the session from getting stuck.
  • Check for any potential deadlocks or race conditions that might occur when the session is retried after auto-compaction.
  • Review the diagnostics flag stuck session to understand the conditions under which it is triggered and how it relates to the session state.

Example

No code snippet can be provided without more context about the implementation details.

Notes

The issue seems to be related to the specific combination of OpenClaw version, model, and compaction mode used. The fact that it happens consistently after auto-compaction and prompt retry suggests a potential bug in the session management or retry logic.

Recommendation

Apply a workaround to manually reset the session state to idle after auto-compaction succeeds, if possible, to prevent the session from getting stuck and blocking all incoming messages. This could involve modifying the retry logic or adding a timeout to detect and recover from stuck sessions.

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 Session lock stuck in 'processing' after context overflow compaction succeeds [1 participants]