Skip to content

Commit 2e85fd6

Browse files
committed
fix: show loading indicator during tool execution (CopilotKit#3055)
The loading spinner only appeared when the last message had role "user". During tool execution the last message can have role "tool", hiding the indicator. Now also show it when the trailing message is a tool result.
1 parent 789ab17 commit 2e85fd6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/react-ui/src/components/chat/Messages.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ export const Messages = ({
112112
/>
113113
);
114114
})}
115-
{messages[messages.length - 1]?.role === "user" && inProgress && (
116-
<LoadingIcon />
117-
)}
115+
{inProgress &&
116+
(messages[messages.length - 1]?.role === "user" ||
117+
messages[messages.length - 1]?.role === "tool") && <LoadingIcon />}
118118
{interrupt}
119119
{chatError && ErrorMessage && (
120120
<ErrorMessage error={chatError} isCurrentMessage />

0 commit comments

Comments
 (0)