-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Recovery chain inconsistency after aborted runs: transient abortedLastRun + incomplete-text prefill cause unstable next-turn state #62322
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: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: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
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.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: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
Give feedbackNo fields configured for issues without a type.
Summary
When an embedded run is aborted, the recovery chain can provide the next turn with an unstable state source:
abortedLastRunis persisted on abort, but later overwritten by subsequent turn results (result.meta.aborted ?? false)replyinjects an aborted hint (The previous agent run was aborted by the user ...)sanitizeThinkingForRecovery()treatsincomplete-textasprefill: trueThis combination appears to let the next turn see partial assistant text + a transient aborted marker, which can lead to inconsistent self-reporting and unstable follow-up behavior.
Observed behavior
Using controlled sacrificial-session experiments:
This reproduces as a soft recovery-state inconsistency, even when hard stuck-lane behavior does not reproduce.
Why this looks like a runtime issue rather than just model behavior
We tested multiple models with the same pattern:
So model style changes the symptom shape, but the root cause still appears to be in the recovery/runtime chain.
Relevant implementation points (current main also appears affected)
src/agents/pi-embedded-runner/thinking.tsRecoveryAssessment = "valid" | "incomplete-thinking" | "incomplete-text"sanitizeThinkingForRecovery(...)incomplete-textpath usesprefill: truesrc/auto-reply/reply/body.tsabortedLastRunis converted into an aborted hint for the next replysrc/agents/command/session-store.tsnext.abortedLastRun = result.meta.aborted ?? falsesrc/process/command-queue.tslane wait exceededappears diagnostic, not self-healingSuggested direction
At minimum, please consider whether one of these should change:
abortedLastRun=true, do not allowincomplete-text -> prefill: trueEnvironment
2026.4.5v2026.4.5Related but not identical
I saw #54964 (zombie session after embedded init failure), which seems adjacent, but this report is specifically about aborted-run recovery semantics and inconsistent next-turn state.