feat(web): attach PDFs, ZIPs, and other files to a turn - #8236
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:
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. |
There was a problem hiding this comment.
Reviewed the new/changed Effect-adjacent code (packages/client-runtime/src/state/attachments.ts, apps/web/src/state/attachments.ts, and the web upload-queue call sites) against the service conventions. The new createAttachmentEnvironmentAtoms factory correctly mirrors createAssetEnvironmentAtoms (runtime passed in, no hidden globals, no ManagedRuntime/runPromise outside the existing atom-command boundary), and no service tags/layers were moved or redefined. One predicate convention issue below.
Posted via Macroscope — Effect Service Conventions
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This change introduces a substantial production workflow for uploading, persisting, transferring, deleting, and downloading user files alongside turns. Its broad runtime surface and server-side file lifecycle warrant human review despite extensive tests and backward-compatible persistence. You can add or adjust custom eligibility rules. Learn more. |
48369dc to
264d9bb
Compare
There was a problem hiding this comment.
Reviewed the web composer/timeline attachment UI. Two interaction findings on changed lines, both about the new needs-reattach / capacity paths giving the user no working path or feedback.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding: the new file-attachment download button in MessagesTimeline renders its filename center-aligned, unlike the visually identical anchor and inert rows next to it.
Posted via Macroscope — UI Consistency
c88f3df to
33d67f9
Compare
7abf833 to
1dd3cc0
Compare
There was a problem hiding this comment.
One finding on the new send-block wording in ChatComposer. The rest of the attachment UI (file rows, paperclip trigger, stash menu file badge, timeline file rows) reuses the existing primitives and row treatments consistently, and the earlier findings on the timeline download row alignment, the marker re-pick path, and the swallowed paste are resolved.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding: the needs-reattach file row label ignores the canReattachFiles guard that the send-block reason uses, so on a server without file-attachment support (or before the capability arrives) the row tells the user to attach again while no attach control is rendered.
Posted via Macroscope — UI Consistency
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by pingdotgg#8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Round-16 rebase onto main (5 commits, headlined by #8236 file attachments in the client). Main's upload-aware send path — capability probes, upload await/retry gating, uploaded-ref turn attachments with dataUrl fallback, draft release on success — is woven into the v2 dispatch flow, timeline user rows render file attachments as download links with the ChatView download handler, and the provider settings editor cleanup keeps the branch's environment-field rows. The codex feedback client flow stays unported, replay testkit configs gained main's environmentThemesDir, and the rpc/settings/docs unions carry both sides. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The file upload APIs and tolerant attachment contracts from #8235 are now on
main. This PR adds the web client for them.The composer accepts PDFs, ZIPs, and other files up to the server's advertised limit through the paperclip button or paste. Uploads start while the user types, survive draft and stash moves, and render as rows that download with the original filename. Unknown attachment types render as inert rows instead of crashing the thread.
One shared upload flow in
packages/client-runtimeowns verification, transfer, release, and size limits. Draft discard, project delete, stash, file removal, and send cleanup all use that flow. Interrupted uploads return as "Attach again" markers instead of disappearing.Release warning: clients with the old image-only attachment contract cannot decode threads that contain file attachments. The compatibility work in #8235 makes the merged server contract tolerant and keeps existing mobile code from treating files as images. Hold the web release until a compatible mobile build is available. #8237 adds mobile file support.
Original work by Theo Browne with Claude Fable 5 in the Claude Code harness. Modernized by GPT-5.6 Sol in the Codex harness.
Note
Medium Risk
Touches the turn send/upload pipeline and draft persistence; threads with file attachments require a tolerant client contract, so release coordination with older mobile builds matters.
Overview
Adds generic file attachments to the chat composer (paperclip, paste, drag) alongside images, with images and files sharing the per-turn attachment cap and server-advertised size limits.
Send and upload path:
ChatViewsnapshots images and files together, runs shared upload/capability checks before and after upload, builds optimistic file rows, and wires timeline on-demand downloads via signed asset URLs. Annotation screenshots respect the combined attachment limit so prompts do not claim crops that were not sent.Composer UX:
ChatComposerstages file rows (upload progress, retry, “attach again” after interrupted uploads), blocks send when capabilities or limits fail, and extends stash restore/save to persisted file uploads with environment checks and expiry verification.Persistence:
composerDraftStorepersists file metadata (upload ids or needs-reattach markers), enforces combined limits, and handles moves across threads/environments. Plan follow-up actions hide while any composer attachment is staged (shouldShowPlanFollowUpPrompt).Timeline: User messages render non-image attachments as download links or inert rows for unknown types. Project/sidebar draft counts include files; project delete passes thread refs when releasing draft uploads.
Reviewed by Cursor Bugbot for commit 129f2ad. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add PDF, ZIP, and generic file attachment support to chat turns
composerDraftStore,attachmentUploadQueue, and prompt stash store to persist file metadata, deduplicate attachments, manage upload lifecycles, and handle cross-environment movesMacroscope summarized 129f2ad.