What happened
On macOS, copying a directory in Finder and pasting it into the Desktop composer creates a normal file-attachment chip. The chip looks sendable, but submitting the message fails with the generic send-failure toast ("Failed to send" / "Please try again").
Expected behavior: a pasted directory should either become the existing Host-bound folder reference used by Reference folder, or be rejected during paste with a clear localized explanation. It must not be staged as a normal file attachment that can only fail during submission.
This should not recursively upload or eagerly enumerate the directory.
How to reproduce
- Open Maka Desktop and an agent session with no turn running.
- In macOS Finder, select a folder and press Cmd+C.
- Focus the Desktop composer and press Cmd+V.
- Observe that the folder appears as a normal file attachment.
- Enter any text if needed and click Send.
- Observe that submission fails with the generic send-failure toast.
Environment
- Maka version or commit: observed in a downstream Desktop build at
3fe9ec9; source inspection confirms the same path is still present in upstream main at f109ccde9
- OS and version: Darwin 25.6.0 (macOS, arm64)
- Surface: Desktop
- Electron: 43.4.1
- Chrome: 150.0.7871.224
- Node.js: 24.18.1
- Locale: zh-CN
Logs, screenshots, or additional context
The visible toast is:
- Title:
发送失败
- Description:
消息暂时无法发送,请稍后重试。
The diagnostic report does not include the underlying renderer/preload exception. The source path explains why the folder first appears valid and only fails at send time:
packages/ui/src/composer.tsx: onInputFiles forwards every clipboard File to onAttachFilePaths without distinguishing a directory.
packages/ui/src/use-composer-attachments.ts: sniffFileMimeType catches a failed file.slice(...).arrayBuffer() read and still stages the item as an attachment.
apps/desktop/src/renderer/attachment-preflight.ts: preflight checks only count and byte size, so a directory-shaped File is not rejected.
apps/desktop/src/preload/attachment-ingest-payload.ts: submission later calls file.arrayBuffer() without mapping an unreadable/directory source to an expected attachment error, so the exception falls through to the generic send failure.
Related but not duplicate:
A focused regression test could paste a directory-shaped clipboard item and assert that it is never staged as an ordinary attachment or allowed to reach encodeIngestItems as a file.
AI assistance: OpenAI Codex inspected the source paths, searched existing Issues and PRs, and drafted this report.
What happened
On macOS, copying a directory in Finder and pasting it into the Desktop composer creates a normal file-attachment chip. The chip looks sendable, but submitting the message fails with the generic send-failure toast ("Failed to send" / "Please try again").
Expected behavior: a pasted directory should either become the existing Host-bound folder reference used by Reference folder, or be rejected during paste with a clear localized explanation. It must not be staged as a normal file attachment that can only fail during submission.
This should not recursively upload or eagerly enumerate the directory.
How to reproduce
Environment
3fe9ec9; source inspection confirms the same path is still present in upstreammainatf109ccde9Logs, screenshots, or additional context
The visible toast is:
发送失败消息暂时无法发送,请稍后重试。The diagnostic report does not include the underlying renderer/preload exception. The source path explains why the folder first appears valid and only fails at send time:
packages/ui/src/composer.tsx:onInputFilesforwards every clipboardFiletoonAttachFilePathswithout distinguishing a directory.packages/ui/src/use-composer-attachments.ts:sniffFileMimeTypecatches a failedfile.slice(...).arrayBuffer()read and still stages the item as an attachment.apps/desktop/src/renderer/attachment-preflight.ts: preflight checks only count and byte size, so a directory-shapedFileis not rejected.apps/desktop/src/preload/attachment-ingest-payload.ts: submission later callsfile.arrayBuffer()without mapping an unreadable/directory source to an expected attachment error, so the exception falls through to the generic send failure.Related but not duplicate:
A focused regression test could paste a directory-shaped clipboard item and assert that it is never staged as an ordinary attachment or allowed to reach
encodeIngestItemsas a file.AI assistance: OpenAI Codex inspected the source paths, searched existing Issues and PRs, and drafted this report.