-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
[Bug]: Repeated hard resets on same session key despite high reserveTokensFloor; retry loop re-injects bootstrap context #63216
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.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.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.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.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
OpenClaw repeatedly hits hard context-overflow resets on a specific group session key:
agent:main:voltti:group:46679641This happens even with high compaction headroom configured (
reserveTokensFlooralready above the recommended value), and after aggressive pruning/compaction tuning.The user-facing fallback message suggests increasing
agents.defaults.compaction.reserveTokensFloor, but in this case it is already high and does not resolve the loop.Environment
2026.4.8openai-codex/gpt-5.3-codexRelevant config at time of failures:
agents.defaults.compaction.reserveTokensFloor: 60000agents.defaults.compaction.reserveTokens: 60000agents.defaults.compaction.keepRecentTokens: 8000agents.defaults.bootstrapMaxChars: 6000agents.defaults.bootstrapTotalMaxChars: 12000agents.defaults.contextPruning.mode: cache-ttlWhat happens
For normal inbound Basecamp events in this thread, OpenClaw repeatedly does:
context overflow detected (attempt 1/3)context overflow detected (attempt 2/3)context overflow detected (attempt 3/3)This cycle repeats across multiple newly restarted session IDs.
Representative logs
Also observed repeatedly in the same failing cycle:
This suggests bootstrap context is re-injected on each retry path for the same failing turn.
Why this looks like a bug
60000), yet resets continue.tool result truncation did not help: empty sessionappears in cases where failures still persist immediately after.Additional related observation
In earlier failing sessions for this same key, duplicate user payloads were observed in transcript history during retries/restarts (same inbound content repeated multiple times with different message IDs/timestamps), which may contribute to avoidable token growth.
Expected behavior
reserveTokensFlooras primary fix.empty session, recovery should either branch to a minimal context execution path or provide a more actionable root-cause diagnostic.Related issues
Request
Please investigate retry-path prompt construction and recovery behavior for cases where: