feat: let agents work with PDFs, ZIPs, and other files - #8092
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This change introduces end-to-end file attachments across web and mobile, including new upload protocols, server-side storage and download handling, provider path integration, draft persistence, and cleanup workflows. Its cross-platform scope and substantial runtime/storage side effects require human review. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
One UI consistency finding in the new web composer file attachment row. Everything else in the changed web scope (the paperclip Button size="icon-sm" + Tooltip/TooltipTrigger render composition, the icon-xs retry/remove actions, the timeline download anchor, and the semantic color tokens used) matches the existing composer/timeline conventions.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding in the changed web UI: the new attachment download link inside the user message bubble hovers to text-primary, which is the solid-control fill role rather than a foreground role owned by the message surface. Details inline. (The unbounded retry tooltip in ChatComposer.tsx file rows from the earlier review is still open; not re-posting it.)
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ae250e2. Configure here.
There was a problem hiding this comment.
One new finding in scope, plus one carried-over finding that is still unresolved.
New: the stashed-file count badge in ComposerStashMenu does not pin a type scale or an icon tone, so it renders larger than every sibling metadata span in the row and its icon is re-colored by the CommandItem primitive. Inline comment below.
Still open from a previous run (not re-posted): apps/web/src/components/chat/MessagesTimeline.tsx:1075 — the file download link on the user message bubble takes its hover color from --primary, which index.css defines as the solid-control fill role rather than a text role owned by the bg-message surface, so the hover state is not guaranteed to stay legible in themed palettes. A message-surface-owned foreground (e.g. the existing text-message-foreground with an opacity/underline hover) keeps the hover state under the surface that renders it.
Everything else in the changed web UI looks consistent: the new composer attach control uses Button variant="ghost" size="icon-sm" inside the standard Tooltip/TooltipTrigger render composition, the failed-upload tooltip now matches the image tile's max-w-64 whitespace-normal leading-tight cap, and the attach affordance is correctly gated out of the collapsed-mobile and approval footers.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
UI consistency review of the changed web files. Two findings, both about draft/stash surfaces that summarize composer attachments and were not updated for the new files list. The previously flagged message-link hover token and the uncapped retry tooltip in ChatComposer are both resolved in this revision.
Posted via Macroscope — UI Consistency
|
YES |

T3 Code only accepted image attachments. PDFs, ZIP archives, and large text files had no direct route to an agent.
Web, desktop, and mobile can now upload files up to 50 MB directly to their environment. Agents receive the saved file path, images keep their existing behavior, and mobile supports the system file picker and share sheet.
Uploads stream to disk, pending files reuse hard links, and downloaded documents cannot run as pages.
The mobile share-sheet change requires a new iOS and Android store build before later OTA updates work.
Built with GPT-5.6 Sol in the Codex harness.
Note
High Risk
Touches signed upload tokens, streamed attachment storage, asset download headers, and mobile share-sheet MIME handling—security-sensitive file ingest and serving paths.
Overview
Agents can now receive generic files (PDFs, ZIPs, etc.), not just images. Servers advertise a
fileAttachmentscapability with a 50 MB upload cap; images keep the existing 10 MB path.Web and mobile composers pick, persist, and upload files alongside images. Mobile copies files into app-owned storage, cleans them when drafts/outbox no longer reference them, and accepts files from the share sheet (
*/*on Android; iOS file share counts). File picking is gated on the server capability.Uploads stream to disk instead of buffering the whole body. Attachment IDs can encode a safe extension so files resolve without directory scans. Pending uploads are claimed with a hard link (copy fallback). Document downloads force
Content-Disposition: attachmentand a sandbox CSP so they cannot execute as pages.Providers still get images as attachments; files are injected as on-disk path lines in the turn text. Legacy image upload tokens remain valid. Mobile share-sheet MIME changes need a new store build before later OTAs.
Reviewed by Cursor Bugbot for commit d014010. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add support for non-image file attachments (PDFs, ZIPs) across web, mobile, and server
ChatFileAttachmenttype andfileAttachmentsenvironment capability (50 MB max) inpackages/contracts/src/orchestration.ts, expandingChatAttachmentbeyond imagesapps/web/src/components/chat/ChatComposer.tsx) supports attaching, uploading, retrying, and removing generic files; drafts and prompt stash persist file references without file bytesapps/mobile/src/lib/composerImages.ts,apps/mobile/src/features/sharing/incoming-share-model.ts) can pick, persist, upload, and clean up generic files viaexpo-file-systemapps/server/src/assets/AttachmentUpload.ts,apps/server/src/attachmentStore.ts) issues typed upload URLs, streams file bodies to disk preserving file extensions, enforces signed byte limits, and serves file assets withContent-Disposition: attachmentheadersapps/server/src/provider/Layers/ProviderService.ts) receive only image attachments in the routed input array; file attachments are referenced via path hints in the input text rather than forwarded as image contentAttachmentUploadClaimsschema adds atypefield defaulting to'image'for legacy tokens — verify all existing upload token decoders handle the new field;attachmentIdExtensionSuffixappends-binfor invalid/missing extensions, so attachment IDs now have a different shape than beforeMacroscope summarized d014010.