-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: Auto-compaction silently fails after context overflow (attempt 1/3 with no follow-up) #90526
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingSomething isn't workingclawsweeper: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.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingSomething isn't workingclawsweeper: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
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
After accumulating ~217 messages during a tool loop, the embedded agent emits [context-overflow-diag] with compactionAttempts=0 and logs "attempt 1/3; attempting auto-compaction", but never proceeds to attempt 2/3 or 3/3. No compaction completed/failed signal is emitted. The prompt silently returns stopReason=end_turn as if it succeeded.
Steps to reproduce
Expected behavior
After "attempt 1/3; attempting auto-compaction" is logged, the agent should either:
(a) Proceed to attempt 2/3 and 3/3 if the first compaction attempt fails, OR
(b) Emit a clear "compaction completed" or "compaction failed" signal.
If all 3 attempts fail, the prompt should return stopReason="error" (not "end_turn") so the caller knows the session is no longer usable.
Actual behavior
Only "attempt 1/3" is logged. No "attempt 2/3", no "attempt 3/3", no "completed", no "failed" signal ever appears in stderr. The agent silently returns stopReason=end_turn (appears as success). Subsequent prompts to the same session produce degraded sentinel outputs (NO_REPLY, HEARTBEAT_OK) instead of meaningful responses.
OpenClaw version
2026.3.13
Operating system
Linux (Alibaba Cloud Function Compute container)
Install method
docker
Model
bailian/qwen3.7-max
Provider / routing chain
openclaw -> bailian (Alibaba Cloud Model Studio) -> qwen3.7-max
Additional provider/model setup details
Compaction mode is set to "safeguard" in openclaw.json (agents.defaults.compaction.mode).
tools.deny includes ["sessions_spawn", "subagents"].
Logs, screenshots, and evidence
Impact and severity
Affected: Any user whose session accumulates enough messages to trigger context overflow during a tool loop
Severity: High (silent failure — caller receives end_turn "success" but session is permanently degraded)
Frequency: 1/1 observed in production when messages reached 217
Consequence: No error is surfaced to the user or ACP caller; session silently becomes unusable
Additional information
No response