diff --git a/ui/src/components/AssistantPanel.tsx b/ui/src/components/AssistantPanel.tsx index 2093564..c02d380 100644 --- a/ui/src/components/AssistantPanel.tsx +++ b/ui/src/components/AssistantPanel.tsx @@ -57,8 +57,12 @@ export function AssistantPanel({ projectName, isOpen, onClose }: AssistantPanelP // Clear stored conversation ID if it no longer exists (404 error) useEffect(() => { if (conversationError && conversationId) { - console.warn(`Conversation ${conversationId} not found, clearing stored ID`) - setConversationId(null) + const message = conversationError.message.toLowerCase() + // Only clear for 404 errors, not transient network issues + if (message.includes('not found') || message.includes('404')) { + console.warn(`Conversation ${conversationId} not found, clearing stored ID`) + setConversationId(null) + } } }, [conversationError, conversationId]) diff --git a/ui/src/hooks/useConversations.ts b/ui/src/hooks/useConversations.ts index 0a59534..c3b50de 100644 --- a/ui/src/hooks/useConversations.ts +++ b/ui/src/hooks/useConversations.ts @@ -27,8 +27,11 @@ export function useConversation(projectName: string | null, conversationId: numb enabled: !!projectName && !!conversationId, staleTime: 30_000, // Cache for 30 seconds retry: (failureCount, error) => { - // Don't retry on 404 errors (conversation doesn't exist) - if (error instanceof Error && error.message.includes('404')) { + // Don't retry on "not found" errors (404) - conversation doesn't exist + if (error instanceof Error && ( + error.message.toLowerCase().includes('not found') || + error.message === 'HTTP 404' + )) { return false } return failureCount < 3