NEXT: attach screen captures at any size, with their original
HOLD: Coordinator review at the current head.
Attach Screenshot… and Attach Window… preserve the full-resolution original in the chat's existing upload storage, read in chunks of at most 512 KiB. The composer gets a bounded preview and the original's file reference within the capture click's one gesture. Only the preview is scaled; the original is never converted to whole-file base64.
Leo: “why are there prompt limits anyways?” and “well we ought to audit the limits and make sure 1. don't have nonsense 2. do some super sweet ergo perf stuff”. He also asked for “arbitrarily large files of any type”.
Removed cap (location on the base): Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentPaneCapture.swift:20,37,51,96: the 5 MiB screenshot threshold that scaled or refused the captured original. The preview's 1.5 MiB/1568-pixel work budgets remain. Existing native staging and Cloud/CLI transport cap removals are already on base (#27016 and #28695).
Capture snapshots its invoking chat and upload stager before opening the system picker. Switching chats cannot route the original to another chat, and Retry and undo reuse its saved reference. Local and Cloud finish responses are handled explicitly. A genuine upload failure retains the original and reports its recovery path; successful capture and cancellation finish temporary-file cleanup before replying.
Hosts without an upload stager and older daemons that report upload support as unavailable still attach the valid preview and show a separate original-file recovery message, retaining the complete original locally. That compatibility repair addresses the blocking review; it does not turn write failures into successful preview-only attachments.
This keeps the native capture/stager lifecycle and its web handoff together: the screenshot's single gesture must cover the saved original, and the composer must carry the resulting reference through Retry and undo. The focused additions repair that same boundary rather than introducing another upload path.
Validation
Current head: 6bf7b099928e0480809a99959d5403f06ae8fbd5.
The final two commits also cover an absent upload stager with an original above 5 MiB. Their fleet compile passed in 305 seconds (job 507b1bc0998e9e833123090b), and all 37 native tests passed (job bb82779199d61f49b17a8d1d). The no-stager regression fails as expected in tests-only commit 3d992fc45205fdb0508317b8139fd54c58f9d0b6 (job d2209992aa6fef01d78dd6f6). All eight head webview shards and all eight base-replay verdicts passed at this exact head (run 41626492085). The completed web results below apply to predecessor 29af12ac9097c033abe8e62538d1a972bf1ec190; web sources are unchanged in the final two commits.
- Fleet compile: passed, job
7743acb9836e55f8092ddee5(288 seconds). - Native suites: 37 tests passed (19 capture and 18 attachment-source), job
a1ca6eaebb790a4a9e7de6bf(AgentPaneCaptureTests,AttachmentSourceTests). - Native regression proof: the unsupported-upload case fails as expected at tests-only commit
dde76b2d3e6936a231ec63e4f41fd1f496717158, jobad97689df90a5f80fbd97b73. - Web checks and 40 focused capture/composer/new-chat tests: passed, run 41614964932.
- Final committed
python3 scripts/cmux-next/prepush-gate.py: passed. - Changed-file formatting, UI-copy scanning, attachment-cap guard, and
git diff --check: passed. Full checks are run remotely.
The large-capture regression generates a noisy 2400×1600 PNG, requires the original to exceed 5 MiB, reads back exact bytes from the staged upload, and verifies bounded chunks plus a scaled preview. Native compatibility tests exercise unsupported begin/chunk/finish separately from real failure, invalid finish responses, and the no-preview case. Gallery scene agent-pane.composer#attach-screenshot-unsupported verifies the preview and recovery note appear together; the existing capture-failure scene verifies genuine failure stays visible.
Observed / Not run
- Observed: source inspection, final static gate, formatting and focused source guards, and fleet compile. Native suites and all focused web tests passed; the focused regression was reproduced. All eight head webview shards and all eight base-replay verdicts passed at the final head. The one exact-head condition wait completed with the known unrelated reds below; no check remains pending. A bounded same-harness replay reproduced all three current gallery failures identically on the exact base (
2181a864354e65527cadde4d6b315ef7597ad5db): changes-git-actions include-new/keyboard layout shifts and settings font-picker menu fit. The per-state classifier reportsown: falsefor every current gallery failure. Unrelated CI failures name the phone-field table (fixed by #33718), GroupJoinHold’s Observation import (fixed by #33680), and stable-next warm-source declarations. The warm-sources test fails with the same two errors on base run 41629470154;test_reds.pyreportsown: false. This diff changes none of those inputs. - Not run: an authenticated live screenshot flow in a DEV build. Gallery images are not a substitute for that outcome.
Risk: capture routing, upload lifecycle, and recovery across native/web boundaries. No timer, observer, or animation loop is added. Original-upload progress remains a separate follow-up in the limits audit (#33015); this PR makes no measured speed claim.
Changelog
- Fixed: screenshot attachments preserve their original at any size, with a bounded preview and recoverable upload failures.
🤖 Generated with Codex
Agent session: agent session