Repository navigation
fix(composer): stream large clipboard attachments and commit Cut after copying - #33533
teamleaderleo wants to merge 13 commits into
Conversation
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
…nces Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Passes: CI passes on CI passes on Written by web and size checks: green Gallery before/after for
States
Pick other states with a |
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
|
Found 2 test failures on Blacksmith runners: Failures
|
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
…-composer-references # Conflicts: # Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentPaneReplyLinks.swift
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
…URLs Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
|
Review (codex gpt-6-astra high, next-review): BLOCK at 9aab0c7 BLOCK at 9aab0c7
|
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-2010f0b89f67a88d2fb1
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
HOLD: this clipboard transaction still needs the coordinator's exact-head review.
Large composer copies now stream into native file references instead of silently omitting attachments or rejecting the whole copy. Copies are tested with 128 attachments, more than 128 MiB combined, text above 8 MiB and an individual attachment above 32 MiB. Large content shows progress, Cancel and Retry. Very large counts still carry metadata in whole bridge requests; I own #33551 to stream that metadata too. Large Cut removes the original selection only after every selected item reaches the clipboard, and preserves edits made during copying. Unavailable items leave valid copies usable with an explicit incomplete-copy warning and Retry; an incomplete Cut keeps its entire draft.
Leo, during the limits audit (2026-11-02):
Caps removed
Original locations at bc55b1e (the small legacy inline method keeps transport bounds; the composer routes larger values through staging):
webviews/src/agent-session/acpmux/composer/composerCopy.ts:25: 32 MiB base64 attachment omission.Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentPaneComposerCopy.swift:33: 64 items;:35: 8 MiB selection/attachment text;:37: 128 MiB aggregate.Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentPaneImageCopies.swift:11: the composer's 32 MiB image-data route now falls back to a file URL; image representation decoding stays bounded. Standalone image-viewer Copy/Save actions remain tracked in Preserve large composer copies, captures, legacy recordings and link lists through file references #33015.Small copies retain the existing bridge route. Larger copies use acknowledged chunks of at most 192 KiB, with file writes on the injected background file lane. Existing base64 is sliced without decoding the complete attachment. Opaque, single-use references are scoped to the pane/session and copy revision. Cancellation, replacement, failure and expiry clean abandoned bytes; only successfully published attachment files persist. A newer copy cannot be overwritten by an older reply. One deadline handles expiry and cancels when no reference needs it; there is no new polling loop.
Ordering and selection metadata travel on the clipboard too, so browser storage quota cannot lose a large prompt when WebKit returns file URLs without plain text. Remote paths retain the existing isolation and denylist rules. SVG sanitization and pixel-decode guards remain safety bounds. The platform's final plain-text clipboard representation still requires a string in memory; attachment bytes remain streamed.
This is the clipboard portion of #33015. Context-rich progress/retry captures are tracked in #33847, which I also own. The native/web transaction, progress UI, deferred Cut and cancellation/security regressions are one coupled change, so it is larger than the usual PR guideline; the tests make up most of the added lines.
Validation
895b721404a97fe1bea050d08370ee6052180755, including the 177 MiB/128-file byte-and-hash case, mixed valid/unavailable 4 MiB Copy, scoped single-use references, cleanup, cancellation and remote-path isolation. The final head changes only web warning cleanup and its test; native sources are identical.895b721404a97fe1bea050d08370ee6052180755(93 seconds).bun run checkpassed at4b0d9b4829dd6cf41b5a17f8947f0dc102c136ad(run, receipt exit 0). The same run fetched the old source atbc4cdfbb05e0bea71cb8858edaefd92c7347dde2: all three new partial-Copy/Cut regressions failed and all ten existing status tests passed, before restoring the final source for the green run. Receipt snapshotf46301bb8c366399b85bc464ea5f657bc2da7735is parented only by the tested head; source tree570b635cee1d46cf22692f872ee40d620e44bdb7.agent-pane.composer-copy-status— copying, finishing, failed and incomplete; follows the composer's quiet status treatment indesign/composer.md. Six earlier renders passed in both themes (run); exact-head context-rich captures and visual review remain in Capture composer clipboard progress and retry states #33847.web / react-apps-base-checkverdicts passed (CI run).repo-worktrees-searchwas reproduced on the exact rendered head907a576a40b114bfbb6bf94629ae6ab84eac5b58and its base8d08eaaf21413c0a39d72231bb54099fe75c31c3: both report shift 0.00699, baseline 0.00447, under the same full Chrome engine (paired replay, both themes, assertions passed). The workflow compared different browser engines across steps; fix(ci): use one browser for gallery head and base renders #33836 fixes that harness mismatch.test_every_compile_job_names_its_warm_sources,test_the_repository_highlights_validate); the per-test classifier reports no own guard failure.8d08eaaf21413c0a39d72231bb54099fe75c31c3reproduce the same errors in seven suites: ActionContractTests, TabSelectionKeepsTabWidthsTests, PaneChromeEvenInsetTests, WindowCleanupCoverageTests, BrowserChromeIconsTests, SidebarLookContractTests and TabSwitchWorkBudgetTests. Two original failures remain unexcused by the per-test classifier: ScriptGestureTests and MarkdownLiveShareTests. ScriptGesture passes at the unchanged head; 16 ScriptGesture and four Markdown baseline repetitions also pass. I own tests: wait for the requested document in ScriptGestureTests #33941 and tests: diagnose missed Markdown live-share reload delivery #33942 for these timing failures. A head Markdown replay is still running; a rerun of the original failed native job is needed before calling this PR ready. The generated-files job propagates the matching ActionContract failure, with no stale export diff.Performance
composer-copy-staging.test.tsChangelog
Fixed: large composer copies and cuts preserve their attachments and show progress while copying.
🤖 Generated with Codex
Agent session: agent session