Skip to content

Any Bot can send the person a file it made, with its contents - #2873

Draft
davidmckayv wants to merge 1 commit into
mainfrom
send-file-contents
Draft

davidmckayv wants to merge 1 commit into
mainfrom
send-file-contents

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

A Bot connected over plain AG-UI that works on its own machine couldn't hand the person a file it made. computer_send_file reads a path on the Bot's OpenBot computer, and it is offered only with that computer. A customer's Bot said it had "no file-attachment channel" and told the person to pick the file up from a path on its machine.

This adds send_file, which every Bot holds on every run, computer or none. It takes the file's name and its contents (the text itself, or base64 with encoding: "base64"). The server answers it and replies in exactly the shape computer_send_file does, so the conversation draws the same file card, live and after a reload.

What this changes:

  • shared/send-file.ts: the tool's name, description and encodings, and isSendFileTool. The description steers a model to send_file for a file OpenBot can't reach and to computer_send_file for one in its OpenBot computer's workspace. The computer tool's description now points the other way too.
  • shared/bot-prompt.ts: every Bot that holds send_file is told to send what it made with it and never to point the person at a path.
  • shared/tool-name.ts: its words ("Sending a file", "Sent a file", "Didn't send a file").
  • app/src/lib/copilot/send-file-tool.tsx: render only. The file card (SentFileCard) from the stored answer, or one line with the server's reason when it was refused. The contents are never drawn.
  • The transcript's sent-file links and a task thread's folds treat it as they treat computer_send_file.

Why a second tool instead of a second way to call the first: the computer's tool names a path that the server pulls through the computer's governed download, and it is offered only with that computer. A Bot on its own machine has no such computer and no path OpenBot can reach. Folded into one tool, its path would mean nothing for most of the Bots that hold it.

API spec: untouched. A tool call travels in the AG-UI stream, and the spec names no tool or tool result shape. The answer reuses computer_send_file's shape, so no new event or render contract.

Red / green

app/tests/send-file-tool.test.tsx draws a stored conversation through the real transcript, twice from scratch to stand for a reload.

  • Red: without the renderer (as on main), the transcript draws no card: Unable to find role="figure" and name "File from the Bot: offsite-notes.md".
  • Green: the card is there with its kind, size and a download of the stored file, on both passes, with none of the contents on the page. A refused file is one line, "Blocked: Send a file", with the server's reason.

shared/tests/artifacts-prompt.test.ts and shared/attachments.test.ts hold the prompt lines and the description's list of what can be sent.

End to end

Run against a real OpenBot built from this branch, its model answered by rule, in Chromium and WebKit: 7 passed. Two stock AG-UI agents that know nothing about OpenBot, each the AG-UI repository's own example, unmodified: the Claude Agent SDK one (ag-ui-claude-sdk, the customer's) and the OpenAI Agents SDK one. Each was connected as a Bot from New Bot and asked for the offsite files. It sent offsite-notes-<tag>.md (UTF-8, with an em dash, an accent and an emoji) and agenda-<tag>.txt (CRLF line ends) with send_file. Each arrived as a file card. The card's own Download button gave exactly the bytes sent, compared byte for byte, before and after a reload. Nothing scrolls sideways at 1440px or 390px, light or dark.

Looked at every screenshot (laptop and phone, light and dark, both browsers, both agents): the cards are the same SentFileCard a file from the computer draws ("Markdown · 99 bytes", "TXT file · 66 bytes", Download), stacked one per row in the column, the Bot's words under them. Before this change there was no screen to compare: the Bot could not send the file at all.

Changelog

Web app and OpenBot Desktop.

  • Added: any Bot can send you a file it made. That includes a Bot connected from its own machine with no OpenBot computer. The file arrives in the conversation as a card with a Download button.

A connected Bot that works on its own machine had no way to hand the
person a file: computer_send_file reads a path on the Bot's OpenBot
computer, and is offered only with that computer. The Bot said it had no
file-attachment channel and told the person to pick the file up from a
path on its machine.

send_file carries the file's name and contents (text, or base64), and
every Bot holds it on every run. The server answers it, checks the bytes
as it checks an upload, and answers in the shape computer_send_file does,
so the conversation draws the same file card, live and after a reload.
This adds the shared name, description and prompt lines, the tool's
words, and the card's renderer.

This branch has not been deployed

No deployments
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