-
- {parts.map(({ part, idx }) => {
- if (part.type === ContentTypes.THINK) {
- const think = part.think;
- const reasoning = typeof think === 'string' ? think : (think?.value ?? '');
- const streaming = isSubmitting && idx === lastContentIdx;
- const label = streaming
- ? localize('com_ui_thinking')
- : localize('com_ui_thoughts');
- return (
-
- );
- }
- return renderPart(part, idx, isLast && idx === lastContentIdx, handleToolExpand);
- })}
-
+
+
+ {parts.map(({ part, idx }, partIndex) => {
+ if (part.type === ContentTypes.THINK) {
+ const think = part.think;
+ const reasoning = typeof think === 'string' ? think : (think?.value ?? '');
+ const streaming = isSubmitting && idx === lastContentIdx;
+ const isAfterTool =
+ partIndex > 0 && parts[partIndex - 1]?.part.type === ContentTypes.TOOL_CALL;
+ const label = streaming
+ ? localize('com_ui_thinking')
+ : localize('com_ui_thoughts');
+ return (
+
+ );
+ }
+ return renderPart(part, idx, isLast && idx === lastContentIdx, handleToolExpand);
+ })}
+
+
+ {hasPendingAuthRequest &&
}
)}
diff --git a/client/src/components/Chat/Messages/Content/__tests__/ContentParts.integration.test.tsx b/client/src/components/Chat/Messages/Content/__tests__/ContentParts.integration.test.tsx
index 45a5fa814f..7ec40c8928 100644
--- a/client/src/components/Chat/Messages/Content/__tests__/ContentParts.integration.test.tsx
+++ b/client/src/components/Chat/Messages/Content/__tests__/ContentParts.integration.test.tsx
@@ -7,8 +7,11 @@ import ContentParts from '../ContentParts';
jest.mock('~/hooks', () => ({
useLocalize: () => (key: string, values?: Record