Repository navigation
[Bug]: Dropped folders become failed file uploads #11961
Description
Activity
Triage
Confirmed on current
main(3efdcc529). Dropping a folder onto the chat (web or desktop) is treated as a file attachment, the upload fails, and Send stays blocked until that chip is removed. Regular file drops still work.What happens
makeWorkspaceFileDropHandlersonly looks atdataTransfer.filesand forwards every entry to the composer:onDrop(event: WorkspaceFileDragEvent) { if (!isFileDrag(event)) return; event.preventDefault(); host.setDragActive(false); host.addFiles(Array.from(event.dataTransfer.files)); },
WorkspaceFileDragEventdoes not exposedataTransfer.items, so the handler cannot seewebkitGetAsEntry().isDirectory/getAsFileSystemHandle(). Chromium still puts aFilefor the folder into.files(often with a non-emptysizeand empty MIME type).That
Filethen follows the normal attachment path:ChatView/ sidebar rows callcomposerRef.addDroppedFiles→addComposerAttachmentsclassifyComposerAttachmentFiletreats empty MIME as a generic"file"- If
file.size > 0, it is staged (thesize <= 0guard does not save this case) attachmentUploadQueuedoesxhr.send(file); Chromium cannot read a directory blob (net::ERR_FILE_NOT_FOUND)- Upload state becomes
failed→ chip shows upload failed →attachmentUploadBlockReasonreturns Retry or remove the failed attachment
The same drop helper is reused for sidebar thread drops (
Sidebar.tsx,LegacySidebar.tsx), so those fail the same way. The attach-file picker istype="file"withoutwebkitdirectory, so this is drop-specific.Related, not duplicates
- [Feature]: Support full folder management and drag-and-drop folder import #6138 (closed) — broader folder import/management
- [Feature]: Pasting paths into prompt window. #1863 (closed) — path paste declined (clipboard/privacy;
@mentions already cover workspace paths) - feat(web): accept file drops across the chat workspace #6636 (merged) — added workspace file drops; files only
- feat(web): accept file drops into sidebar threads #7892 (merged) — sidebar drops reuse this helper
- Closed path-mention PRs (Insert file mentions when non-image files are dropped on the composer #5390, feat(web): insert path mentions for non-image file drops and pastes #5543, feat(composer): drop non-image files as filesystem paths #7749, feat(composer): drop non-image files as filesystem paths #8549) — earlier “insert a path instead of attaching” work; not a live fix. Generic file attachments shipped after those.
No open PR matches this folder-drop → failed-upload path.
Suggested fix
Keep this as a bugfix, not a folder-import feature:
- In
workspaceFileDrop, inspectdataTransfer.itemsand skip directory entries beforeaddFiles - Mixed drops: attach real files, ignore folders
- Optional toast: folders cannot be attached; use
@or paste a path - Unit-test a directory
DataTransferItemso it never reachesaddFiles
Codex-style folder references can stay a separate enhancement. Even without that, a dropped folder should not create a failed attachment that blocks Send.
Workaround: remove the failed chip, then paste the path or
@-mention something in the workspace.- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.acceptedfeature request acceptedfeature request acceptedvia-triageFiled through npx t3 triageFiled through npx t3 triage
on Sep 15, 2026
Before submitting
Area
apps/web— shared by web and desktop. Observed on desktop and reproduced in the browser.Steps to reproduce
Expected behavior
I expect a folder reference or path, as Codex desktop displays. If the selected client or environment cannot support that, explain the limitation without creating a failed attachment.
Actual behavior
T3 treats the folder as a file attachment and shows upload failed. Send becomes disabled with the label Retry or remove the failed attachment.
Dropping an ordinary text file into the same composer uploads successfully.
Impact
Minor bug or occasional failure. Sending is blocked until the failed attachment is removed.
Version or commit
Browser reproduction:
mainat3efdcc529, package version0.0.40. Original desktop version not recorded.Environment
Ubuntu 26.04 LTS, Chromium 143.0.7499.4, Node.js 24.18.0; local T3 server. Browser reproduction used Playwright 1.61.1 and Chromium's native drag API with a real filesystem folder.
Logs or stack traces
The browser identifies the dropped item as a directory, but the shared drop handler forwards it to the attachment uploader without checking directory entries.
Screenshots, recordings, or supporting files
Screenshots collected for this report:
Codex CLI 0.154.0 and Claude Code 2.1.269 also accept pasted folder paths as editable text. These were paste checks, not drag-and-drop tests. Claude Desktop was not tested.
Workaround
Remove the failed attachment and paste the folder path as text. This re-enabled Send in the browser test. The path must be accessible to the selected environment.
Related reports
@path flow. This report concerns the failed upload; the choice of folder-reference behavior remains open.