From 15696f641aeb6e0f737ffeae2176fb074541ea6f Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 5 Jun 2026 18:36:32 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20unified=20attach=20button?= =?UTF-8?q?=20referenced=20undeclared=20toolResource?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit handleUnifiedUpload called setToolResource(undefined) and the unified-mode FileUpload passed a bare `toolResource` — neither is declared at component scope (only toolResourceRef exists; setToolResource is local to dropdownItems). Clicking the single attach button therefore threw a ReferenceError and never opened the file picker, so the unified upload flow was dead. Use toolResourceRef.current, matching the legacy path. Slipped past CI because the client builds via Vite (transpile-only) and the TypeScript-check job doesn't cover client/. Caught by the new e2e/specs/mock/unified-upload.spec.ts. --- client/src/components/Chat/Input/Files/AttachFileMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Chat/Input/Files/AttachFileMenu.tsx b/client/src/components/Chat/Input/Files/AttachFileMenu.tsx index 59597171dd..182cfa19d6 100644 --- a/client/src/components/Chat/Input/Files/AttachFileMenu.tsx +++ b/client/src/components/Chat/Input/Files/AttachFileMenu.tsx @@ -144,7 +144,7 @@ const AttachFileMenu = ({ /** Unified mode: single click triggers file upload with no tool_resource */ const handleUnifiedUpload = () => { - setToolResource(undefined); + toolResourceRef.current = undefined; handleUploadClick(); }; @@ -314,7 +314,7 @@ const AttachFileMenu = ({ { - handleFileChange(e, toolResource); + handleFileChange(e, toolResourceRef.current); }} >