feat: support image attachments on user messages
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 Message type and converted to AI SDK image parts (a data: URL) at the provider boundary, which Anthropic, Google, and OpenAI-compatible providers all accept.
Highlights:
- New
ImageAttachmenttype threaded through the submit chain (useChatHandler,useAppHandlers,app-util,message-builder, chat-input/user-input). - Clipboard paste via
Ctrl+V(macOSosascript, Linuxwl-paste/xclip, Windows PowerShell). - Image file paths typed/pasted/dragged into the terminal are resolved to attachments and stripped from the message text.
- ACP image content blocks 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 can't see images (the image is still sent).UserInputlists pending attachments (Ctrl+Xremoves the last);UserMessageshows an attached-image count.
Note: the ACP and
message-converterportions existed in a partially-applied, non-compiling state on the base; this PR completes them (adds the missingImageAttachmenttype they imported and restores a droppedreturnin the user branch ofconvertToModelMessages).
Type of Change
- [ ] Bug fix
- [x] New feature
- [ ] Breaking change
- [ ] Documentation update
Testing
Automated Tests
- [x] New features include passing tests in
.spec.ts/tsxfiles - [ ] All existing tests pass (
pnpm test:allcompletes successfully) - [x] Tests cover both success and error scenarios
pnpm test:typesandpnpm test:lintpass, and all new/updated specs pass (clipboard-image,vision-support,message-converter,acp-content).pnpm test:allcurrently fails on 3 pre-existing tests insource/utils/tool-result-display.spec.tsxthat also fail onmainand are unrelated to this change.
Manual Testing
- [x] Tested with Ollama
- [ ] Tested with OpenRouter
- [ ] Tested with OpenAI-compatible API
- [ ] Tested MCP integration (if applicable)
Checklist
- [x] Code follows project style guidelines
- [x] Self-review completed
- [ ] Documentation updated (if needed)
- [x] No breaking changes (or clearly documented)
- [x] Appropriate logging added using structured logging (see CONTRIBUTING.md)
https://github.com/user-attachments/assets/92d77d82-2771-48c1-adcd-bb9443c2b5c5