feat: support image attachments on user messages#572
Conversation
Add multimodal image input across the chat surfaces: - New ImageAttachment type carried on user messages, converted to AI SDK image parts at the provider boundary (data URL accepted by Anthropic, Google, and OpenAI-compatible providers). - Clipboard paste (Ctrl+V) and drag/typed image file paths become attachments; image path tokens are stripped from the message text. - ACP image content blocks are collected as attachments; unsupported media types and audio are noted rather than silently dropped. - modelSupportsVision() heuristic drives a non-blocking warning when the active model likely cannot see images (the image is still sent). - UserInput shows pending attachments with Ctrl+X to remove the last; UserMessage shows an attached-image count. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves the CodeQL "incomplete string escaping" alert: the test built its escaped path by replacing spaces only, leaving any pre-existing backslash unescaped. Escape backslashes first, then spaces, so the encoding is complete for any path. Behavior is unchanged for the temp paths under test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Hey @ragini-pandey - this is a brilliant PR. Thank you for building this. It works well and below are mostly some quality of life comments :)
Love this though. Cannot wait to merge! Let me know if there are any other questions or thoughts! |
Description
Adds multimodal image input to user messages across all chat surfaces (interactive TUI, VS Code prompt path, and ACP). Images are carried as base64 on the internal
Messagetype and converted to AI SDK image parts (adata:URL) at the provider boundary, which Anthropic, Google, and OpenAI-compatible providers all accept.Highlights:
ImageAttachmenttype threaded through the submit chain (useChatHandler,useAppHandlers,app-util,message-builder, chat-input/user-input).Ctrl+V(macOSosascript, Linuxwl-paste/xclip, Windows PowerShell).modelSupportsVision()heuristic drives a non-blocking warning when the active model likely can't see images (the image is still sent).UserInputlists pending attachments (Ctrl+Xremoves the last);UserMessageshows an attached-image count.Type of Change
Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist
Screen.Recording.2026-06-14.at.6.40.47.PM.mov