Two issues with image handling in chat:
1. Images pasted/dropped in chat were uploaded to disk but only file
paths were sent as plain text. The model never received actual image
bytes. Now sends base64 image data as `attachments` in the chat.send
RPC so vision-capable models can see images directly.
2. Attached file paths (e.g. assets/screenshot.png) were not prefixed
with the workspace root, unlike [Context: workspace file '...'] paths.
The agent couldn't resolve relative paths. Now both patterns get the
workspace prefix.
Files changed:
- chat-panel.tsx: read images as base64 via FileReader, send as FileUIPart
- chat/route.ts: extract image file parts, prefix attached file paths
- gateway/chat/route.ts: accept attachments in request body
- active-runs.ts: thread attachments through startRun
- agent-runner.ts: forward attachments to chat.send RPC
- chat-message.tsx: render inline image previews in user messages
Made-with: Cursor