openclaw - 💡(How to fix) Fix [Bug][P0] /reset leaves corrupted session state - session-recovery dead loop causes all subsequent messages to get no reply [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#63099Fetched 2026-04-09 07:58:37
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

After executing /reset command via QQ Bot channel, the gateway correctly processes the reset and sends confirmation messages. However, it leaves a corrupted session state with an incomplete thinking assistant message. All subsequent messages from the user receive no reply for 45+ minutes until a WebSocket 4009 reconnect establishes a new session.

Error Message

  • 16:51:56 - 2nd message: same error -> no reply
  • 16:55:38 - 3rd message (user: "what happened, no reply after reset") -> same error -> no reply

Root Cause

/reset\ clears conversation context but does not clean up the session's incomplete thinking state. The session-recovery mechanism then repeatedly drops messages upon detecting the orphaned incomplete thinking, but fails to recover to a working state.

RAW_BUFFERClick to expand / collapse

Description

After executing /reset command via QQ Bot channel, the gateway correctly processes the reset and sends confirmation messages. However, it leaves a corrupted session state with an incomplete thinking assistant message. All subsequent messages from the user receive no reply for 45+ minutes until a WebSocket 4009 reconnect establishes a new session.

Environment

  • OpenClaw version: 2026.4.2
  • Node.js: 22.22.1
  • Channel: openclaw-qqbot (QQ Bot via WebSocket)
  • OS: Ubuntu (cloud VM)

Steps to Reproduce

  1. Have an active conversation with the bot via QQ
  2. Send /reset\ to clear context
  3. Send any follow-up message

Expected Behavior

After /reset, the bot should respond normally to new messages.

Actual Behavior

  1. /reset\ itself succeeds - confirmation message is sent (67+59+38 chars)
  2. All subsequent messages are received by the gateway (\C2C_MESSAGE_CREATE\ logged)
  3. But for every message, session-recovery triggers: \
    [session-recovery] dropped latest assistant message with incomplete thinking: sessionId=d4055336-9e68-4e7a-851c-3f945ecea892 \\
  4. No \deliver called\ or \Sent markdown\ appears - the agent generates no reply at all
  5. This persists until a WebSocket 4009 disconnect triggers a new session (waited 45 minutes)

Log Evidence

Reproduced 3 times consecutively on 2026-04-08 16:44-16:55 (Beijing Time):

  • 16:44:44 - /reset\ processed, reply sent successfully
  • 16:45:16 - 1st message: \session-recovery dropped...incomplete thinking\ -> no reply
  • 16:51:56 - 2nd message: same error -> no reply
  • 16:55:38 - 3rd message (user: "what happened, no reply after reset") -> same error -> no reply
  • 17:29:55 - WebSocket 4009 reconnect -> new session -> recovery

Root Cause Analysis

/reset\ clears conversation context but does not clean up the session's incomplete thinking state. The session-recovery mechanism then repeatedly drops messages upon detecting the orphaned incomplete thinking, but fails to recover to a working state.

Suggested Fix

  • /reset\ should fully clear session state including any in-progress thinking markers
  • OR session-recovery should fall back to creating a fresh session when it detects persistent incomplete thinking after a reset

extent analysis

TL;DR

The most likely fix is to modify the /reset command to fully clear the session state, including any in-progress thinking markers, to prevent the session-recovery mechanism from dropping messages.

Guidance

  • Verify that the /reset command is correctly clearing conversation context but not the session's incomplete thinking state by checking the logs for the "session-recovery dropped" error message after a reset.
  • Consider modifying the session-recovery mechanism to fall back to creating a fresh session when it detects persistent incomplete thinking after a reset.
  • Review the OpenClaw version 2026.4.2 documentation to see if there are any known issues or configuration options related to session state management.
  • Test the suggested fix by sending a /reset command and then a follow-up message to see if the bot responds normally.

Example

// Example of how the /reset command could be modified to clear session state
function resetSession() {
  // Clear conversation context
  clearContext();
  // Clear in-progress thinking markers
  clearThinkingMarkers();
}

Notes

The suggested fix assumes that the issue is caused by the /reset command not fully clearing the session state. However, without more information about the OpenClaw implementation, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Modify the /reset command to fully clear the session state, including any in-progress thinking markers, to prevent the session-recovery mechanism from dropping messages. This is because the current implementation of the /reset command does not fully clear the session state, leading to the corrupted session state and subsequent errors.

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