-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Auto-compaction during ongoing turn silently abandons task execution without resumption #59618
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-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.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.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.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Bug Description
When automatic context compaction triggers during an ongoing conversation turn (while tools are executing), the task execution is silently abandoned without resuming. Unlike overflow recovery (where
willRetry=trueensures the prompt is retried after compaction), regular auto-compaction lacks a mechanism to continue the interrupted task.Root Cause
The
willRetrymechanism inhandleAutoCompactionEnd()only applies to overflow recovery scenarios. When regular auto-compaction triggers mid-turn:Reproduction Example
From session log analysis:
Expected Behavior
After automatic compaction during a turn, the agent should resume execution and complete the current task, similar to how
willRetry=trueworks for overflow recovery.Actual Behavior
The task is silently abandoned. The agent stops processing after compaction, leaving the turn incomplete.
Related Code
File:
agents/pi-embedded-subscribe.handlers.compaction.ts:69-76Issue: Regular auto-compaction (not triggered by overflow) goes to the
elsebranch, which only resolves the wait but does not continue execution.Suggested Fix
@jalehman
Option 1: Delay compaction until turn completes
Option 2: Include execution state in summary
executionStatefield to compaction summary containing:Option 3: Universal post-compaction resume
checkIncompleteTurn()and callcontinueExecution()Environment