Skip to content
7 changes: 7 additions & 0 deletions src/core/task/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2118,6 +2118,13 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {

this.abort = true

// Reset streaming state so the UI unlocks immediately.
// Without this, task switches that call abortTask() without going
// through resumeAfterDelegation() leave isStreaming=true, causing
// the chat input to remain locked (issue #257).
this.isStreaming = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we preserve the previous streaming state for cleanup before flipping this? dispose() still uses this.isStreaming && this.diffViewProvider.isEditing to revert active diff edits, and cancelTask() treats isStreaming === false as the signal to rehydrate, so clearing it synchronously here may skip cleanup or race the abort save.

this.isWaitingForFirstChunk = false

// Reset consecutive error counters on abort (manual intervention)
this.consecutiveNoToolUseCount = 0
this.consecutiveNoAssistantMessagesCount = 0
Expand Down
Loading