Repository navigation
fix: keep loading indicator on streaming assistant message in agent chat - #18172
Conversation
The last assistant message dropped its loading state as soon as the first content chunk arrived, so the spinner vanished while the answer was still streaming. Tie the indicator to sendLoading only. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe chat loading indicator remains active for the latest assistant message while sending, regardless of message content. ChangesAssistant loading state
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
wangq8
left a comment
There was a problem hiding this comment.
LGTM. Simple and targeted fix — removing !message.content from the loading condition means the spinner no longer disappears as soon as the first streaming chunk arrives. The loading indicator now correctly stays visible while sendLoading is true, regardless of whether content has started streaming. The condition derivedMessages.length - 1 === i still ensures this only applies to the last message. One edge case to keep in mind: if sendLoading remains true after the stream completes (e.g., due to an upstream bug), the spinner would linger. That is a separate concern and not introduced by this change.
Approved.
Summary
fix: keep loading indicator on streaming assistant message in agent chat
The last assistant message dropped its loading state as soon as the first content chunk arrived, so the spinner vanished while the answer was still streaming. Tie the indicator to sendLoading only.