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.
JavaScript a2aagentic-aiai-agentsdevtoolsmcp-clientn8n-alternativeno-codeopen-sourceorchestrationsmythosvisual-builder
Revert "Update AIChat component to use 'isPending' for chat creation status; add conditional session initialization based on last conversation ID." . This reverts commit 574fa0ed18f9f26e63e3c9ba16e0f9976315b539.
Salman-Ahamedb7659f510834
diff --git a/packages/app/src/react/features/ai-chat/pages/ai-chat.tsx b/packages/app/src/react/features/ai-chat/pages/ai-chat.tsxindex 0ad4e846..8740b9da 100644--- a/packages/app/src/react/features/ai-chat/pages/ai-chat.tsx+++ b/packages/app/src/react/features/ai-chat/pages/ai-chat.tsx@@ -70,7 +70,7 @@ const AIChat: FC<AIChatProps> = ({});const { data: agentSettingsData } = useAgentSettings(agentId || '');- const { mutateAsync: createChat, isPending: isChatCreating } = useCreateChatMutation();+ const { mutateAsync: createChat, isLoading: isChatCreating } = useCreateChatMutation();const { mutateAsync: updateAgentSettings } = useUpdateAgentSettingsMutation();// Custom Hooks - optimized@@ -155,12 +155,18 @@ const AIChat: FC<AIChatProps> = ({currentAgent.aiAgentSettings = agentSettingsData.settings;currentAgent.id = agentId;- if (!currentAgent?.aiAgentSettings?.lastConversationId) {- createNewChatSession();- }+ // Always start with a clear session when opening the chat+ createNewChatSession();}}, [agentSettingsData, currentAgent, agentId, createNewChatSession]);+ // Ensure clean state on mount - clear chat history every time page loads+ useEffect(() => {+ clearMessages();+ setShowScrollButton(false);+ isFirstMessageSentRef.current = false;+ }, []); // eslint-disable-line react-hooks/exhaustive-deps+useEffect(() => {if (!isAgentLoading && !isQueryInputDisabled) {queryInputRef.current?.focus();