Skip to content

feat(core): let bots read attached files and see attached images - #395

Open
davemooreuws wants to merge 1 commit into
send-attachmentsfrom
read-attachments
Open

davemooreuws wants to merge 1 commit into
send-attachmentsfrom
read-attachments

Conversation

@davemooreuws

@davemooreuws davemooreuws commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Third of the chat attachments PRs, stacked on #394: read_thread_file reads what people attach.

  • A file is read as text when it was given a text type (in any encoding), or when its bytes are UTF-8 without NULs, so source code typed video/mp2t still reads. Anything else is refused after reading its first chunk.
  • PNG, JPEG, GIF and WebP are shown to models that take images, typed by their bytes (detectMediaType from the AI SDK) and capped at 5 MiB encoded. read_file now types its images the same way.
  • Images are counted, not kept, when a tool call's output is stored, so later turns' history no longer carries base64.
  • Whether a model takes images is now loaded once with the turn's context and shared by the sandbox tools and read_thread_file.
  • Through OpenRouter, the images a tool returns go in a user message after its result, with a note where each was. Gemini there refuses a request with an image in a tool result once its reasoning is in the request. Tool images also move from the AI SDK's deprecated image-data part to file.

Part of SUGA-1825

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sugabots-website 6e91da3 Oct 16 2026, 06:45 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant