-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
TUI Esc abort can leave stale optimistic busy state #86199
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for 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: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.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for 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: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.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
The TUI can remain stuck in the busy-submit path after pressing Esc to abort a pending run. The first Esc successfully aborts the backend run, but the local optimistic submit flag remains set, so the next normal prompt is blocked with:
Pressing Esc again then reports:
because both tracked run ids are already clear while
pendingOptimisticUserMessageis still true.Current behavior
The TUI submit guard treats
pendingOptimisticUserMessageas busy state.abortActive()clearspendingChatRunIdafter a successful abort, but it does not clearpendingOptimisticUserMessage.That can leave the TUI in a contradictory local state:
no active runExpected behavior
After a successful Esc abort of the active or pending TUI run, the TUI should clear all local pending-submit state for that run so the next prompt can be sent normally.
Expected behavior:
pendingChatRunIdis clearedpendingOptimisticUserMessageis clearedabortedNotes
Relevant paths:
src/tui/tui-command-handlers.tsblocks normal submits whenpendingOptimisticUserMessageis set.src/tui/tui-session-actions.tsclearspendingChatRunIdon successful abort, but currently leavespendingOptimisticUserMessageset.Acceptance criteria
pendingChatRunIdandpendingOptimisticUserMessageare set.