Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
When user clicks Stop in webchat and compaction runs concurrently, the next message is routed to a brand-new session instead of the original, causing total context loss.
Steps to reproduce
- Have a long webchat conversation with an agent 2. Send a message that triggers a long tool call or generation 3. Click Stop to abort 4. Wait for compaction to run (generates .reset file) 5. Send the next message 6. Agent responds as if it's a brand new conversation — all prior context lost
Expected behavior
Aborting a generation should keep the user in the same session. The next message should load the full conversation history from before the abort.
Actual behavior
Framework creates a new session (1c9239d5) and remaps agent::main from the old session (7cb5dff5) to the new one. sessions.json confirms restartRecoveryRuns was populated despite this being a user-initiated RPC abort, not a Gateway restart.
OpenClaw version
2026.6.10
Operating system
Windows 11 (x64)
Install method
No response
Model
deepseek/deepseek-v4-pro
Provider / routing chain
DeepSeek API (direct)
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
Confirmed against unmodified npm install (openclaw@2026.6.10).
All dist files timestamp 2026-06-25 22:40:28 — no source modifications.
Evidence: sessions.json shows restartRecoveryRuns populated on a user-initiated RPC abort.
Related: #70472, #14463
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 28, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 28, 2026, 5:34 AM ET / 09:34 UTC.
Summary
Keep open: current main and v2026.6.10 include the older compaction-failure session-preservation fix, but the newer WebChat RPC Stop plus compaction path that leaves restartRecoveryRuns and remaps the active session is not proven fixed. The open Stop-recovery PR and restart-recovery PRs are adjacent, but none cleanly owns this exact report yet.
Reproducibility: no. high-confidence end-to-end reproduction was run. The source path is clear enough to keep open: sessions.compact interrupts active runs through chat.abort, chat.abort records rpc cancellation, and restart recovery can still write restartRecoveryRuns.
Ways to help us reproduce this
Next step
Manual review is safer because this session-state race overlaps open WebChat Stop and restart-recovery PRs and needs live reproduction before queueing another fix PR.
Review details
Best possible solution:
Add focused coverage and a fix for the RPC Stop plus compaction path so user aborts do not leave restartRecoveryRuns or remap the active WebChat session, then validate with live WebChat proof.
Do we have a high-confidence way to reproduce the issue?
No high-confidence end-to-end reproduction was run. The source path is clear enough to keep open: sessions.compact interrupts active runs through chat.abort, chat.abort records rpc cancellation, and restart recovery can still write restartRecoveryRuns.
Is this the best way to solve the issue?
Unclear for implementation shape: the older compaction reset fix is already present, but this report likely needs either an extension of the open Stop-recovery work or a narrower restartRecoveryRuns guard with live proof.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against d17b970bb50d.
Label changes
Label justifications:
P1: The report describes a current-release WebChat workflow losing conversation continuity after Stop and compaction.impact:session-state: The failure is drift between the active WebChat session key, session id, and restart-recovery lifecycle state.impact:data-loss: The old transcript may remain on disk, but the active conversation is remapped so prior context appears lost to the user.maturity:stable: The affected Gateway/WebChat RPC surface matches gateway-runtime, which the maturity shortlist reports as M4 Stable.Evidence reviewed
What I checked:
src/gateway/server-methods/sessions.ts:2437, d17b970bb50d)src/gateway/server-methods/chat.ts:3219, d17b970bb50d)src/gateway/chat-abort.ts:454, d17b970bb50d)src/agents/main-session-restart-recovery.ts:254, d17b970bb50d)src/auto-reply/reply/agent-runner-execution.ts:1378, aa69b12d0086)Likely related people:
src/gateway/server-methods/sessions.ts,src/gateway/session-lifecycle-state.ts,src/agents/main-session-restart-recovery.ts)src/gateway/chat-abort.ts,src/gateway/server-methods/chat.ts,src/gateway/server-methods/sessions.ts)src/agents/main-session-restart-recovery.ts,src/gateway/chat-abort.ts)src/agents/main-session-restart-recovery.ts,src/gateway/server-close.ts)src/auto-reply/reply/agent-runner-execution.ts,src/auto-reply/reply/agent-runner-execution.test.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.keaideweiertuode commentedon Jun 30, 2026
Confirmed — same behavior here
Setup: OpenClaw 2026.6.10 + DeepSeek V4 Flash, WebChat UI on Ubuntu 24.04 (npm install).
What happened
In a long conversation, I clicked Stop to abort a lengthy generation. After that, compaction ran (likely triggered by the context overflow). The next message was routed to a brand new session — the agent had no memory of the prior conversation.
Checked
sessions.jsonafterward and confirmedrestartRecoveryRunswas populated, even though this was a user-initiated RPC abort, not a Gateway restart.Additional context
The session that aborted had accumulated ~800KB of context (largely due to tool output bloat described in #97651). The combination of Stop + compaction + context pressure seems to trigger the same recovery path as a Gateway restart.
Workaround
Avoid clicking Stop in WebChat on long sessions for now. Refreshing the page before sending the next message seems safer.
Let me know if you need any more details from the session state.
openclaw-barnacle commentedon Jul 15, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
barnacle-openclaw commentedon Jul 22, 2026
Closing due to inactivity.
If this is still an issue, please retry on the latest OpenClaw release and share updated details.
If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.