Repository navigation
Closed
Labels
plan:donePlanboard status
Description
Goal
Let users attach images and folders to a chat message in the composer, and deliver them to the agent.
Current state
- Prompt is a plain
stringat every layer:Composer.onSend->useCoder.startRun->runs:startIPC ->runner.startRun-> provider argv/stdin. ChatMessagehas onlytext; no attachment field.- No file picker (only project directory pickers), no drag-drop, no paste handling in the composer.
- @-mentions insert literal
@pathtext; nothing is read or resolved. - Inbound image machinery exists (
electron/tool-images.js) but only for tool results.
Plan
- Data model (
src/shared/ipc.ts): addAttachmentInfo { kind: "image"|"folder", path, name }; add optionalattachmentstoChatMessageandruns.startinput. - IPC (
electron/preload.js,electron/ipc.js): new channelsattachments:pick(native dialog, files+folders),attachments:saveImage(persist pasted/dropped image bytes under userData, returns path),attachments:readImage(data URL for thumbnails). ExposewebUtils.getPathForFilevia preload for drag-drop paths. - Runner (
electron/runner.js): store attachments on the user message; append an attachments section (absolute paths) to the dispatch prompt so every provider (claude stdin NDJSON, codex/grok/kimi/opencode argv) can read them with its normal file tools. - Composer (
src/components/Composer.tsx): per-thread attachment state, chips row with image thumbnails and folder names, paperclip button, paste handler, drag-drop;onSend(prompt, attachments); clear on successful send. - Threading (
ThreadView.tsx,App.tsx,useCoder.ts): pass attachments through toruns.start. - Transcript (
ThreadView.tsx): render attachment chips/thumbnails on user messages. - Stubs:
src/devCoder.ts+src/wireClient.tsimplementations for the newCoderApimembers. - Tests: composer attachment UI, runner dispatch-prompt attachment section, IPC handler coverage.
Out of scope: provider-native image blocks (e.g. claude stream-json content arrays); path references work for all providers since agents run locally.
Metadata
Metadata
Assignees
Labels
plan:donePlanboard status
Activity
currentbits commentedon Aug 15, 2026
Implemented in worktree 53c77b8b: AttachmentInfo type + ChatMessage.attachments, attachments:pick/fromPaths/saveImage/readImage IPC channels (electron/attachments.js), runner stores attachments on the user message and appends an absolute-path section to the dispatch prompt for all providers, Composer chips with pick/paste/drag-drop, transcript thumbnails, devCoder/wireClient stubs. Tests: 649/649 renderer, 737/737 electron (incl. 10 new), core and memory-server green. Not committed.
currentbits commentedon Aug 18, 2026
Follow-up: drag-and-drop never became the primary path — the picker is still what people use. Filed #469 (window-wide drop, folders via DataTransferItem paths, overlay). Backend from this ticket is fine; the composer-only
dataTransfer.fileshandler is the gap.