Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Assistant error state (#36907)

Saxon Fletcher182986bb1d60
diff --git a/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx b/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx
index c54c899f46c..55889cafcbe 100644
--- a/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx
+++ b/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx
@@ -149,6 +149,8 @@ export const AIAssistant = ({ className }: AIAssistantProps) => {
isLoading: isChatLoading,
append,
setMessages,
+ error,
+ reload,
} = useChat({
id: snap.activeChatId,
api: useBedrockAssistant
@@ -439,6 +441,17 @@ export const AIAssistant = ({ className }: AIAssistantProps) => {
{hasMessages ? (
<div className="w-full px-7 py-8 space-y-6">
{renderedMessages}
+ {error && (
+ <div className="border rounded-md pl-2 pr-1 py-1 flex items-center justify-between">
+ <div className="flex items-center gap-2 text-foreground-light text-sm">
+ <Info size={16} />
+ <p>Sorry, I'm having trouble responding right now</p>
+ </div>
+ <Button type="text" size="tiny" onClick={() => reload()} className="text-xs">
+ Retry
+ </Button>
+ </div>
+ )}
<AnimatePresence>
{isChatLoading && (
<motion.div