-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Bug: Preemptive context overflow silently kills embedded sessions without notifying user #84536
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:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request 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: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:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.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:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request 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: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:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.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.
Bug: Preemptive context overflow silently kills embedded sessions without notifying user
OpenClaw version: 2026.5.19-beta.1 (ba9034b)
Gateway: running (systemd)
Affected agent(s): agent:marcus:main, agent:jordan:main, agent:neon (multiple agents same day)
Channel: webchat
First seen: 2026-05-19 08:45 UTC
Last seen: 2026-05-20 12:20 UTC
Description
Embedded agent sessions enter a terminal error state (
Context overflow: estimated context size exceeds safe threshold during tool loop) during tool loops. The session silently dies with no user notification. The error is logged but never delivered to the user's channel. Sessions remain stuck in aprocessingstate for hours until manually restarted.Expected: user sees
Context overflow: prompt too large for the model. Try /resetimmediately.Actual: silence, frozen session, no message delivered, no self-healing.
Steps to Reproduce
embedded_run_agent_endwith errorprocessingstateExpected Behavior
Actual Behavior
embedded_run_agent_end+ errorcompactionAttempts=0— preemptive check short-circuits before in-attempt compactionprocessingstateEnvironment
Relevant Logs
Root Cause Analysis
The issue is in the embedded Pi runner's preemptive context overflow handling (
selection-BpjGe-Y0.js):PREEMPTIVE_OVERFLOW_RATIO = 0.9is hardcoded — no config path, not tunablemaxContextChars = 200,000 × 4 × 0.9 = 720,000 charscompactionAttempts=0— preemptive check short-circuits before the in-attempt compaction path is reachedCode locations:
selection-BpjGe-Y0.js:9325—PREEMPTIVE_OVERFLOW_RATIO = .9hardcodedselection-BpjGe-Y0.js:9495—maxContextChars = Math.floor(contextWindowTokens * 4 * 0.9)selection-BpjGe-Y0.js:9537-9538— throws error without running compactionpi-embedded-BpxGOwmb.js— in-attempt compaction never reachedAdditional Context
Multiple agents hit this on 2026-05-19:
Key evidence this is NOT actual context exhaustion:
compactionAttempts=0— pre-emptive check fired, not model rejectionobservedTokens=unknown— no token count was measuredSeverity
High — agents silently die, no user notification, requires manual restart. No self-healing. Recurring across multiple agents.