Skip to content
Docs menu

Attaching files from ChatGPT and other hosted assistants

How a hosted assistant with no shell keeps the files you attached to a conversation with a person in Petawork People, why the upload URL does not work there, and what each error means.

View .md

A hosted assistant (ChatGPT, Claude.ai) runs your connector's tools from its vendor's servers. It has no shell and its model cannot make an HTTP request of its own; where it can run code, that code is not given a network to reach your Petawork with. So the two-step upload cannot finish there: people_image_prepare answers an upload URL, and nothing in the assistant can PUT the file to it. The assistant reports a network or name resolution error and the file is never kept.

Petawork has a way in that does not need the PUT.

Which way to use

Where the agent runs Way in
A shell (Claude Code, Codex, the petawork CLI) the two-step upload: prepare, curl -T, then the product's tool with the upload_id
ChatGPT, with files attached to the conversation people_file_attach
Any client that fills a tool argument from a file itself file_base64 on people_attachment_add, or image_base64 on people_image_add
A file already at a public https address file_url on people_attachment_add, url on people_image_add

Files from the conversation: people_file_attach

{ "name": "people_file_attach", "arguments": { "person": "<person id>", "files": [ "<the attached files>" ] } }

The assistant does not type the files. The tool declares files as a file parameter (_meta["openai/fileParams"], the OpenAI Apps SDK's way to pass files to a tool), so ChatGPT fills each entry in itself with a short-lived download address and an id:

{ "download_url": "https://files.oaiusercontent.com/…", "file_id": "file_…", "mime_type": "image/png", "file_name": "chat.png" }

Petawork fetches each address once and keeps the bytes as they are.

ChatGPT fills files in only for a tool it was given the definition of, so the tool has to be in the connection's tool list. It is in People's core set: it is listed when the connector's address is /workspace/mcp/people, and on /workspace/mcp once People is switched on for the connection (Petawork for agents). A connector added before this tool existed keeps its old list until you refresh its tools in ChatGPT's connector settings.

  • Up to 10 files in one call, 4 MB each.
  • The type is read from the bytes: images (PNG, JPEG, WebP, GIF), PDFs, office documents, text, audio, video and zip archives. SVG and HTML are refused. A picture joins the person's images; anything else is kept as a file.
  • Only the person's owner can attach. Someone else's person answers "No such person" and nothing is fetched.
  • The answer lists every file: kept, already kept, or not kept and why, with the SHA-256 of the bytes kept.
  • It is safe to call again. A file whose bytes are already kept with the person is not kept a second time, so after a failure the assistant repeats the call with the same files.

What Petawork fetches, and from where

The fetch is the only outbound call this makes, and it happens only when a tool call carries a file:

  • only from a chat app's own file host: files.oaiusercontent.com. An address on any other host is refused, and so is a redirect that leaves the list;
  • https on the standard port only, and the address must be public: private, loopback, link-local and cloud metadata addresses are refused even behind an allowed name;
  • at most 4 MB and 15 seconds for each file;
  • no cookie, token or other credential is sent. Your Petawork access token never goes to the file host.

OpenAI's reference does not name the host its download addresses are on; files.oaiusercontent.com is the one its examples show. If ChatGPT serves a file from somewhere else, the tool's answer names the host it refused.

An operator of a self-hosted Petawork Cloud can add exact host names with VENOM_HOST_FILE_HOSTS (comma-separated, for example files.example.com). No wildcards, ports or IP addresses.

Bytes in the call

A client that reads the file and fills the argument itself can send the bytes as base64: file_base64 with file_name on people_attachment_add (any type People keeps), or image_base64 on people_image_add. One call carries at most 2 MiB, so about 1.5 MB of file. The type is read from the bytes, and the same bytes sent again for the same person are answered as already kept.

A model that has to type the base64 itself should not do this for anything over about 50 KB: it is slow, it fills the context window, and one wrong character corrupts the file.

Errors and what to do

The tool says What happened What to do
The file was never uploaded to …: no PUT of the file's bytes reached it an upload was prepared and the PUT was never made in a hosted assistant, use people_file_attach; with a shell, run the curl line the prepare tool answered
the chat app sent only a placeholder ("chat_upload") in place of the file the app passed a marker with no download address. ChatGPT's phone apps have been reported to do this ask again from chatgpt.com in a browser, or add the file on the person's page
the chat app handed over no download address the file entry has no download_url the same
The download address is not taken: it is on … the address is not on a chat app's file host attach the file to the conversation; for a public address use file_url
the chat app's download address has expired or was withdrawn the app's link stopped working before Petawork fetched it attach the file again and repeat the call
The file is over 4.0 MB one file is at most 4 MB send a smaller copy; 1600 pixels on the long side is plenty for a screenshot
SVG is not taken / not a type Petawork keeps the bytes are not a type People keeps send a PNG or JPEG of it
No such person, or it is not yours to see the person is not the caller's own use a person you own

Claude.ai

Claude's connectors move files with a different mechanism (MCP's File Uploads and Downloads extension, in beta), in which Claude sends the file to the server. Petawork does not implement it yet. In Claude.ai, use a public address (file_url) or add the file on the person's page. Claude Code has a shell and uses the two-step upload.

Notes and Finance

globe_file_prepare and finance_document_prepare have the same limit: a hosted assistant cannot make their PUT. Their answers now say so. Petawork Notes and Finance documents do not take conversation files yet; from a hosted assistant, give url (a public address) to globe_file_upload or finance_document_create, or add the file in the app.