Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

Fix: Update SystemMessage component to handle both message and thinkingMessage states

Salman-Ahamed9e2f27e66882
diff --git a/packages/app/src/react/features/ai-chat/components/system-message.tsx b/packages/app/src/react/features/ai-chat/components/system-message.tsx
index 5c6ffbd2..9d309e31 100644
--- a/packages/app/src/react/features/ai-chat/components/system-message.tsx
+++ b/packages/app/src/react/features/ai-chat/components/system-message.tsx
@@ -34,7 +34,7 @@ export const SystemMessage: FC<ISystemMessageProps> = (props) => {
const contentRef = useRef<HTMLDivElement>(null);
- if (!message) return null; // if message is empty, return null
+ if (!message && !thinkingMessage) return null; // if message is empty, return null
return (
<div className="system-message-bubble relative">
diff --git a/packages/app/src/react/features/ai-chat/hooks/use-chat.ts b/packages/app/src/react/features/ai-chat/hooks/use-chat.ts
index 0b84f0e3..345f2550 100644
--- a/packages/app/src/react/features/ai-chat/hooks/use-chat.ts
+++ b/packages/app/src/react/features/ai-chat/hooks/use-chat.ts
@@ -229,10 +229,7 @@ export const useChat = (config: IUseChatConfig): IUseChatReturn => {
if (lastMessageIndex >= 0 && prev[lastMessageIndex].type === 'system') {
// Optimized: Only update last element without copying entire array
const newMessages = prev.slice(0, -1);
- newMessages.push({
- ...prev[lastMessageIndex],
- thinkingMessage,
- });
+ newMessages.push({ ...prev[lastMessageIndex], thinkingMessage });
return newMessages;
}