fix: message bubble streaming status not cleared when new segment arrives
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
調査の方向性
Start with src/tui/messageBubble.js and src/tui/conversationArea.js, tracing how localStreaming changes through pub/sub and how finalizeStreaming and handleInterrupt end a stream. Reproduce the case by starting the TUI and adding a system message during an assistant response. Done means the prior assistant bubble stops showing its spinner after the next segment arrives; verify the relevant behavior in the existing tests, whose paths are not named in the issue.
索引モデルが issue の本文から書いたものです。
説明
Summary
A message bubble's streaming status is not cleared when a new message segment arrives after it. A pending AI message that is interrupted by a system message still shows a spinner erroneously, even though the AI stream has ended.
Environment
- OS: Linux 7.0.14-23-pve
- Node.js: v25.8.1
- madz version: 1.117.0
- LLM provider: Unknown — user to confirm
Reproduction
Steps to reproduce the behavior:
- Run
npm startto launch the TUI. - Send a chat message that triggers a streaming assistant response.
- While the assistant message is streaming, trigger a system message (e.g., a command that adds a system message, or an interrupt followed by a system message).
- Observe the assistant message bubble.
Expected Behavior
The assistant message bubble's streaming status should be false once a new message segment arrives after it. The spinner should stop, and the bubble should render as a completed message.
Actual Behavior
The assistant message bubble still shows a spinner (streaming status remains true) even though a new message segment has arrived after it. The bubble appears to still be streaming when it is not.
Additional Context
The message bubble's streaming state is managed in src/tui/messageBubble.js via localStreaming, which is set from the streaming prop and updated via pub/sub. The streaming flag is set to false in finalizeStreaming in src/tui/conversationArea.js. If a system message is added after the assistant message without the assistant message's streaming flag being cleared, the bubble retains its spinner. The pendingState computation in messageBubble.js (role === "assistant" && localStreaming && segments.length === 0 && !localContent) also relies on the streaming flag being accurate.
Audit Findings (for Issue #1454)
- src/tui/messageBubble.js:498 —
pendingStateis computed asrole === "assistant" && localStreaming && segments.length === 0 && !localContent. The spinner is rendered whenpendingStateis true. IflocalStreamingis not cleared when a new segment arrives after the assistant message, the spinner persists. - src/tui/messageBubble.js:272,328 —
localStreamingis initialized from thestreamingprop and updated via pub/sub (data?.streaming). It is only cleared when a publish carriesstreaming: false. - src/tui/conversationArea.js:908-944 —
finalizeStreamingsetsstreaming: falseon the message viaupdateMessage, which publishes to the bubble and clears the spinner. This is the normal completion path. - src/tui/conversationArea.js:171-211 —
handleInterruptsetsstreaming: falseon the message directly (without callingfinalizeStreaming), which also clears the spinner via pub/sub. - src/tui/messageList.js:40-51,685 —
shouldRenderBubblekeeps an assistant bubble visible if it is streaming OR has non-empty content/segments. An interrupted assistant bubble with only reasoning/partial segments is kept visible, so its spinner state must be accurate.
The likely root cause: when a new message segment (e.g., a system message) is added after an assistant message, the assistant message streaming flag is not reliably cleared. This can happen if the stream is interrupted or errors without finalizeStreaming/handleInterrupt firing streaming: false, or if a system message is added via addMessage (which does not touch the assistant message streaming flag). Verify that every path that ends an assistant stream clears the streaming flag on the bubble, and that adding a subsequent message segment does not leave a stale streaming: true on a prior assistant bubble.
- 主要言語
- JavaScript
- スター
- 2
- フォーク
- 0
- 平均マージ
- 1時間 32分
- マージ済み PR(30日)
- 222
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
avoidwork/madz のほかの issue
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
メンテナーはふだん 1 日以内に返信
-
Cloudredirectオープン
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NanmiCoder/dsh-agent-teams#277 ·
メンテナーはふだん 1 日以内に返信
-
[ordering-review] workshop order graph: 1 confirmed ordering problem, 3 cycles are false positivesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
githubnext/gh-aw-workshop#4943 ·
メンテナーはふだん 1 日以内に返信