🐛 fix: unified attach button referenced undeclared toolResource

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.
This commit is contained in:
Danny Avila 2026-06-05 18:36:32 -04:00
parent e351280207
commit b488672ae6

View file

@ -147,7 +147,7 @@ const AttachFileMenu = ({
/** Unified mode: single click triggers file upload with no tool_resource */
const handleUnifiedUpload = () => {
setToolResource(undefined);
toolResourceRef.current = undefined;
handleUploadClick();
};
@ -318,7 +318,7 @@ const AttachFileMenu = ({
<FileUpload
ref={inputRef}
handleFileChange={(e) => {
handleFileChange(e, toolResource);
handleFileChange(e, toolResourceRef.current);
}}
>
<TooltipAnchor