@@ -280,12 +280,21 @@ for raw binary responses, not provider JSON containing base64 or tools that fetc
280280Keep provider-specific limits and bounded reads; a file declaration is not permission to enlarge
281281arbitrary JSON responses.
282282
283+ Attachment readers that download files inside ` transformResponse ` need their own bounded reads:
284+ the first response cap does not cover subsequent fetches. Accept ` ToolResponseContext ` as the third
285+ transform argument, forward its ` signal ` , and share one ` AttachmentDownloadBudget ` across sequential
286+ downloads. Prefer raw provider endpoints over base64 metadata. Return the same file object in the
287+ declared ` file ` / ` file[] ` output and nested message associations; ` FileToolProcessor ` stores it once
288+ and replaces every alias with the same ` UserFile ` in both workflow and Copilot execution.
289+
283290Preserve stored ` UserFile ` fields (` id ` , ` key ` , ` url ` , ` context ` , ` type ` , ` name ` , ` size ` ) in transforms;
284291rebuilding the old ` { name, mimeType, data, size } ` shape discards the reference. File outputs do not
285292need duplicate inline text/base64 aliases; the file system handles content materialization. When
286- an existing tool exposes those aliases or nested inline file data , preserve its legacy version and
293+ an existing tool explicitly exposes content aliases in its contract , preserve its legacy version and
287294use the existing block/tool version pattern for a file-only output. Test a file over 10 MiB through
288- executor admission, single persistence, trusted ownership, and the unchanged JSON cap.
295+ executor admission, single persistence, trusted ownership, and the unchanged JSON cap. Avoid adding
296+ top-level filename, size, MIME type, URL, or success fields that merely repeat the canonical file or
297+ tool result; keep additional provider fields only when they convey distinct information.
289298
290299### Output Types
291300- ` 'string' ` , ` 'number' ` , ` 'boolean' ` - Primitives
0 commit comments