Skip to content

fix: keep loading indicator on streaming assistant message in agent chat - #18172

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/agent-chat-assistant-loading
Aug 12, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/agent-chat-assistant-loading

Conversation

@dcc123456

Copy link
Copy Markdown
Collaborator

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.

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]>
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. 🧰 typescript Pull requests that update Typescript code labels Aug 12, 2026
@dcc123456
dcc123456 requested a review from wangq8 August 12, 2026 09:20
@dcc123456 dcc123456 added the ci Continue Integration label Aug 12, 2026
@dcc123456
dcc123456 marked this pull request as draft August 12, 2026 09:20
@dcc123456
dcc123456 marked this pull request as ready for review August 12, 2026 09:20
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 12f44d34-4cf6-4dfd-bf5b-71eb69f4e8f8

📥 Commits

Reviewing files that changed from the base of the PR and between eada2f6 and 713ca3e.

📒 Files selected for processing (1)
  • web/src/pages/agent/chat/box.tsx

📝 Walkthrough

Walkthrough

The chat loading indicator remains active for the latest assistant message while sending, regardless of message content.

Changes

Assistant loading state

Layer / File(s) Summary
Update loading condition
web/src/pages/agent/chat/box.tsx
The latest assistant message remains marked as loading during sending. The empty-content requirement was removed.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: wangq8, euvre

Poem

A rabbit watched the spinner glow,
While messages began to flow.
“With content or none,
The latest one
Stays loading till sending says go!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the fix to keep the loading indicator visible during assistant message streaming.
Description check ✅ Passed The description includes the required Summary section, explains the issue, and describes the implemented fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@wangq8 wangq8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@wangq8
wangq8 merged commit 544b7c1 into infiniflow:main Aug 12, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants