From 62c6fd9f46757f96daa085f2b920b2ac967659ef Mon Sep 17 00:00:00 2001 From: Leo Borcherding Date: Wed, 25 Feb 2026 17:27:10 -0600 Subject: [PATCH] fix(attachment): replace never exhaustive check to fix Colab TS2322 build error `attachment.type` resolves to `string & {}` via @assistant-ui/store@0.1.6's generic type chain when installed through npm (package-lock.json), breaking the `const _exhaustiveCheck: never = type` exhaustive check pattern. Replace with a direct throw that compiles cleanly across library versions while preserving identical runtime behaviour. Fixes #263 Co-Authored-By: Claude Sonnet 4.6 --- studio/frontend/src/components/assistant-ui/attachment.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/studio/frontend/src/components/assistant-ui/attachment.tsx b/studio/frontend/src/components/assistant-ui/attachment.tsx index c53c134ea2..94e30fb4ac 100644 --- a/studio/frontend/src/components/assistant-ui/attachment.tsx +++ b/studio/frontend/src/components/assistant-ui/attachment.tsx @@ -149,10 +149,8 @@ const AttachmentUI: FC = () => { return "Document"; case "file": return "File"; - default: { - const _exhaustiveCheck: never = type; - throw new Error(`Unknown attachment type: ${_exhaustiveCheck}`); - } + default: + throw new Error(`Unknown attachment type: ${type as string}`); } });