Skip to content

fix: clear message bubble streaming status when new segment arrives - #1456

Merged
avoidwork merged 3 commits into
mainfrom
fix/fix-message-bubble-streaming-status
Oct 21, 2026
Merged

avoidwork merged 3 commits into
mainfrom
fix/fix-message-bubble-streaming-status

Conversation

@avoidwork

@avoidwork avoidwork commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Description

Fixes issue #1454: a message bubble's streaming status is not cleared when a new message segment arrives after it. A pending AI message interrupted by a system message still shows a spinner erroneously. This change ensures the streaming flag on a prior assistant bubble is cleared when a subsequent message segment arrives, and adds a defensive spinner guard in MessageBubble rendering.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)
  • Performance improvement
  • CI / build / tooling

Testing

  • npm run test: 4206 tests pass, 0 fail.
  • npm run lint: 0 warnings, 0 errors.
  • npm run coverage: 91.48% overall line coverage maintained.
  • Added regression tests in tests/unit/tui/messageList.test.js (addMessage clears stale streaming on a prior assistant message) and tests/unit/tui/messageBubble.test.js (no spinner when a bubble has content/segments despite a stale streaming: true).

Coverage

  • Line coverage maintained

Checklist

  • npm run lint passes
  • Tests pass with maintained line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

Closes #1454

OpenSpec change for issue #1454. Ensures the streaming flag on a prior
assistant bubble is cleared when a subsequent message segment arrives,
and adds a defensive spinner guard in MessageBubble rendering.
@avoidwork avoidwork added the bug Something isn't working label Oct 21, 2026
@avoidwork avoidwork self-assigned this Oct 21, 2026
Implements the fix for issue #1454. When a new message segment is added
after an assistant message, clear any stale streaming flag on the prior
assistant bubble so the spinner stops. Adds a defensive guard in
MessageBubble so a bubble with content/segments never renders a spinner.

- src/tui/messageList.js: clear stale streaming on prior assistant messages in addMessage
- src/tui/messageBubble.js: document defensive pendingState guard
- tests: add regression tests for both behaviors
Archives the OpenSpec change and syncs the updated specs for
component-message-bubbles and tui-streaming.
@avoidwork

Copy link
Copy Markdown
Owner Author

Audit Results — fix-message-bubble-streaming-status (Implementation Audit)

Goal Fulfillment

  • Goal 1 (clear stale streaming on prior assistant bubble when new segment arrives): Implemented in src/tui/messageList.js addMessage. When a new message segment is added, any prior assistant message with streaming: true is cleared to false and the bubble is notified via pub/sub.
  • Goal 2 (defensive spinner guard): Implemented in src/tui/messageBubble.js. The pendingState computation is documented as a defensive guard — a bubble with content or segments never renders a spinner, even with a stale streaming: true.
  • Goal 3 (regression tests): Added tests in tests/unit/tui/messageList.test.js (addMessage clears stale streaming) and tests/unit/tui/messageBubble.test.js (no spinner when content/segments present despite stale streaming).

Spec Compliance

  • component-message-bubbles MODIFIED requirement: The MessageBubble streaming-status lifecycle clears the streaming flag when a new message segment arrives. ✓
  • tui-streaming MODIFIED requirement: Every path ending an assistant stream clears the streaming flag. The addMessage clearing covers the "subsequent message segment" path; finalizeStreaming and handleInterrupt already cover the normal and interrupt paths. ✓

Task Completion

  • All 8 tasks in tasks.md marked [x]. Verified via openspec instructions apply → state: all_done.

Quality Check

  • Tests: 4206 pass (npm run test).
  • Lint: 0 warnings, 0 errors (npm run lint).
  • Coverage: 91.48% overall, maintained. messageBubble.js 93.61%, messageList.js 78.84%.
  • npm start: Fails only due to Ink raw mode requiring a TTY (non-interactive sandbox limitation). Both changed modules import cleanly, confirming no code-level startup defect.

Decision

  • Structured decision: 0.99 (≥ 0.6 → true, no errors). Implementation satisfies every goal, is spec-compliant, tasks complete, no obvious issues.

@avoidwork
avoidwork merged commit 59dcb96 into main Oct 21, 2026
2 checks passed
@avoidwork
avoidwork deleted the fix/fix-message-bubble-streaming-status branch October 21, 2026 12:00
@avoidwork avoidwork mentioned this pull request Oct 21, 2026
6 of 12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: message bubble streaming status not cleared when new segment arrives

1 participant