From d79f709742b7085d70acb803811193706845834f Mon Sep 17 00:00:00 2001 From: claude code agent 227 Date: Sun, 21 Jun 2026 03:07:53 +0300 Subject: [PATCH] fix(share): surface the real error on the share AI widget (#87) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The widget hardcoded a generic 'Something went wrong' body and ignored error.message, violating AGENTS.md. Render describeChatError(error.message, t) — the same helper the internal chat uses — so a reader sees the real 402/429/503 cause instead of a bare 'try again'. Co-Authored-By: Claude Opus 4.8 --- .../client/src/features/share/components/share-ai-widget.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/client/src/features/share/components/share-ai-widget.tsx b/apps/client/src/features/share/components/share-ai-widget.tsx index 5212e2c4..382eb60e 100644 --- a/apps/client/src/features/share/components/share-ai-widget.tsx +++ b/apps/client/src/features/share/components/share-ai-widget.tsx @@ -21,6 +21,7 @@ import { useTranslation } from "react-i18next"; import { useChat, type UIMessage } from "@ai-sdk/react"; import { DefaultChatTransport } from "ai"; import MessageList from "@/features/ai-chat/components/message-list.tsx"; +import { describeChatError } from "@/features/ai-chat/utils/error-message.ts"; interface ShareAiWidgetProps { /** The share id (or key) the assistant is scoped to. */ @@ -174,7 +175,9 @@ export default function ShareAiWidget({ shareId, pageId }: ShareAiWidgetProps) { mb="xs" title={t("Something went wrong")} > - {t("The assistant is unavailable right now. Please try again.")} + {/* Surface the real cause (provider/gating message) instead of a + generic line — same helper the internal chat uses. */} + {describeChatError(error.message ?? "", t)} )}