Skip to content

fix(task): reset isStreaming in abortTask to prevent UI lock after task switch (fixes #257)#388

Open
proyectoauraorg wants to merge 7 commits into
Zoo-Code-Org:mainfrom
proyectoauraorg:fix/257-streaming-state-reset
Open

fix(task): reset isStreaming in abortTask to prevent UI lock after task switch (fixes #257)#388
proyectoauraorg wants to merge 7 commits into
Zoo-Code-Org:mainfrom
proyectoauraorg:fix/257-streaming-state-reset

Conversation

@proyectoauraorg
Copy link
Copy Markdown
Contributor

@proyectoauraorg proyectoauraorg commented May 29, 2026

Fixes #257. Resets isStreaming and isWaitingForFirstChunk in abortTask() so the UI unlocks immediately when a task is aborted or abandoned during task switch. All delegation tests pass (14/14).

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where aborting a task could leave the interface in a locked state due to uncleared streaming indicators.

Review Change Stack

proyectoauraorg and others added 4 commits May 26, 2026 00:05
…provider

Merging 12 new test cases covering completePrompt, streaming resilience, and edge cases.
Dependabot bump. Compatible: project requires node>=20.20.2, uuid v14 requires node>=20.
# Conflicts:
#	pnpm-lock.yaml
…ter task switch

When a task switch occurs via abortTask() (e.g., removeClineFromStack,
clearTask), the isStreaming flag was not being reset. This left the chat
input locked in 'API Request...' state because ClineProvider checks
getCurrentTask()!.isStreaming to determine if the UI should be enabled.

Added isStreaming=false and isWaitingForFirstChunk=false reset in
abortTask() alongside the existing abort=true flag, ensuring the UI
unlocks immediately when a task is aborted or abandoned.

Fixes Zoo-Code-Org#257
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f2e83489-7903-449c-8405-40e5e9a0ee9d

📥 Commits

Reviewing files that changed from the base of the PR and between 48ea5d4 and 790b55d.

📒 Files selected for processing (1)
  • src/api/providers/__tests__/mimo.spec.ts
💤 Files with no reviewable changes (1)
  • src/api/providers/tests/mimo.spec.ts

📝 Walkthrough

Walkthrough

This PR fixes a UI lockup issue where chat remains stuck in "API Request..." state after switching tasks or contexts. The abortTask() function now resets streaming-related UI flags (isStreaming and isWaitingForFirstChunk) immediately when abort is triggered, allowing the chat input to re-enable and accept new messages.

Changes

Task Abort Streaming State Reset

Layer / File(s) Summary
Reset streaming UI state on task abort
src/core/task/Task.ts
abortTask() now resets isStreaming and isWaitingForFirstChunk flags immediately after setting abort = true, preventing UI lockup when task switches occur without full session delegation/resume flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested reviewers

  • taltas
  • navedmerchant
  • hannesrudolph
  • edelauna
  • JamesRobert20

Poem

🐰 A task switch no longer leaves the chat in chains,
Streaming flags reset, freedom regains!
No more "API Request" locks the poor soul,
Abort now completes, and messages roll.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is missing the required template structure, including a formal 'Related GitHub Issue' section, detailed 'Description' of implementation, and 'Test Procedure' with verification steps. Expand the description to follow the repository template: add a formal 'Closes: #257' section, detail the implementation approach in 'Description', and document test procedures for reviewers.
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope changes: a uuid dependency version bump (uuid ^11.1.0) and removal of a Mimo provider test unrelated to the #257 streaming state issue, introduced from a shared base. Separate out-of-scope changes into dedicated commits or PRs: move uuid version pin and Mimo test removal to a separate maintenance PR focused on those specific issues.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: resetting isStreaming in abortTask to fix UI lock after task switch, and directly references issue #257.
Linked Issues check ✅ Passed The PR changes address the core issue #257 requirement by resetting isStreaming and isWaitingForFirstChunk flags during task abort to prevent UI lock after task/context switches, with test coverage confirmed (14/14 delegation tests pass).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@taltas
Copy link
Copy Markdown
Contributor

taltas commented May 29, 2026

Screenshot 2026-05-29 at 11 11 10 am Did you mean to commit this?

An accidental uuid 11.1.0→14.0.0 bump leaked into this branch and broke the
Windows unit tests: uuid@14 drops the Math.random fallback and now requires
globalThis.crypto.getRandomValues, which the Vitest forks pool on Windows
(Node 20) does not provide. Reverting to ^11.1.0 matches upstream/main and
restores green CI. Also removes tmp/README.md, an editor scratch file that
was committed by mistake.
@proyectoauraorg
Copy link
Copy Markdown
Contributor Author

Good catch — that tmp/README.md was an accidental local scratch file and has now been removed (816121f).

I also reverted an unintended uuid 11→14 bump that was causing the Windows unit-test failures on this branch, so CI should be back to normal. Thanks for flagging it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Chat can remain stuck on "API Request..." and stop sending after task/context switch

2 participants