Skip to content

fix: preserve loading indicator when tool messages are appended#2

Open
HowieG wants to merge 1 commit into
mainfrom
fix/3055-loading-indicator-tool-execution
Open

fix: preserve loading indicator when tool messages are appended#2
HowieG wants to merge 1 commit into
mainfrom
fix/3055-loading-indicator-tool-execution

Conversation

@HowieG

@HowieG HowieG commented Feb 24, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • Verify nx run @copilotkit/react-ui:build passes (confirmed locally)
  • Test chat with a tool-calling agent: loading indicator should remain visible while tool executes
  • Verify loading icon still appears after a user message when inProgress is true
  • Verify isCurrentMessage is correctly set on the last visible (user/assistant) message

🤖 Generated with Claude Code

…lotKit#3055)

When tool messages (role="tool") are appended after an assistant message,
they shift array indices causing isCurrentMessage to become false for the
assistant message, which makes the loading indicator disappear. Fix by
calculating lastVisibleMessageIndex based on user/assistant roles instead
of using messages.length - 1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@palazzetti

Copy link
Copy Markdown

Hello @HowieG , do you know if there is any plan to merge your PR in the main CopilotKit repository main branch? it would be very helpful to fix the tool loading issue.

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: Missing loading indication when working with tools

2 participants