-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
[Bug]: Hard context reset destroys in-progress task state with no recovery path #55366
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper 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.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper 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.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
When an agent hits the context limit and compaction cannot recover enough space, OpenClaw fires a hard session reset with this message:
The reset wipes all in-progress task state, leaving the agent with no memory of what it was doing. For long-running data tasks (e.g., reading an Excel file and writing to Google Sheets), this means the task must be restarted from scratch, with no way to resume.
Expected Behavior
On hard reset, OpenClaw should inject a minimal recovery context into the new session — at minimum:
This would allow the agent to resume intelligently rather than going completely blank.
Actual Behavior
Session is wiped. Agent responds as if it has never seen the conversation. User must re-explain the entire task.
Reproduction
Environment
agents.defaults.compaction.reserveTokensFloor: 25000(above suggested threshold),contextTokens: 160000,keepRecentTokens: 20000Notes
The hard reset is understandable as a last resort, but the UX impact is severe for task-oriented agents. Even a one-sentence summary of the last instruction injected into the reset context would dramatically improve recoverability.
Related: this is one of the systemic issues flagged in #55298 comments — compaction/context management needs a more graceful degradation path.