Repository navigation
fix(chat): restore large attachments without losing queued sends - #92223
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 7:30 PM ET / 23:30 UTC (Revision 28). ClawSweeper reviewWhat this changesThe branch makes large chat attachment parsing and restoration stack-safe, preserves failed-send queues, and strengthens Windows CI process cleanup with supporting test corrections. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main still contains the attachment-restoration defects. The retained real-flow evidence supports the fix, the updated body resolves the previous screenshot-delivery blocker, and no introduced blocking defect was found. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI sends attachments through the Gateway, which stores their media references in conversation history. Rewind and Fork read that history back into the composer so users can edit and resend attachments. flowchart LR
A[Selected or pasted attachment] --> B[Chat composer]
B --> C[Gateway attachment validation]
C --> D[Stored media and conversation]
D --> E[Rewind or Fork]
E --> F[Restore supported image bytes]
F --> B
B --> G[Failed-send queue]
G --> H[Reload and retry]
H --> C
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +24, Tests +530, Config +128. Total +682 across 25 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep attachment validation with the shared media owner, restore canonical inbound references through existing guards, and retain failed sends for explicit retry. Do we have a high-confidence way to reproduce the issue? Yes: send a supported-size image and restore it through Rewind; supplied real baseline evidence shows the missing attachment, and current main retains the responsible reader and validator. This review did not execute current main. Is this the best way to solve the issue? Yes: the patch repairs existing parsing and restoration owners while preserving admission limits, malformed-input rejection, and durable queued sends. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ab202aa1e12c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (27 earlier review cycles; latest 8 shown)
|
|
Confirmed this fixes a real 2026.6.6 production failure mode. Observed on a local Gateway running The failing path matches the pre-fix I also ran the PR branch attachment tests locally: This PR looks like the canonical fix rather than opening another duplicate PR for the same issue. |
bbcca2e to
91e66f5
Compare
|
@BSG2000 thank you for the test-merge map — it was exactly right and made this repair fast. The branch is rebuilt as you suggested: one fresh commit on current What changed relative to the old branch:
Real-behavior proof on the exact head is in the PR body under Happy to have you re-run the test merge — GitHub reports the branch mergeable against current |
|
@clawsweeper re-review Exact head
The previously flagged stored-data-model change no longer exists — the PR touches no queue serialization code. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@joeykrug re-ran the verification on the exact head
The evidence block (bundle-hash-verified served UI, 9.0 MB PDF + 4.3 MB pasted image with From my side this is ready — ClawSweeper's re-review is queued and should update its verdict on the exact head shortly. Thanks for turning the repair around so quickly and cleanly. |
Resolve current attachment parsing changes and remove the stale data-URL helper import.
Exact-head attachment restoration proofHead Real built Gateway + served Control UI on sanitized AWS Crabbox, with a 4 MiB synthetic PNG and loopback synthetic provider. No production credentials or external channel sends.
Before — image missing after real RewindAfter — image restored to composerFull capturesBaseline: base-proof.mp4Equivalent exact-head flow: head-proof.mp4Additional rewind-resend / Fork-resend: extended-proof.mp4Captures are complete, normal-speed recordings with a SHA/title strip above the original pixels; no generated scenes or behavior edits. Originals and deterministic transforms are preserved. Baseline API/state evidence · Head API/state evidence · Supplemental resend evidence (broker URLs expire after seven days; GitHub media above is persistent). Runs: baseline, qualification, resends, evidence supplement. Gateway/provider fixtures are joined/closed. Both PR images rendered at1440×1000 in an anonymous browser (run_eed631dc8344). The inspected pair was also displayed in this visible owner chat; originating-parent-chat delivery receipt remains pending before landing. |
Retain verified member handles before terminating the job and require every handle to be signaled before returning from the existing ten-second drain. Reject membership growth rather than authorize reuse from zero job accounting. Add original-return-boundary and PID-reuse/racing-member regression coverage; regenerate the canonical CI consumer.
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Merged via squash.
|


Closes #90098.
What Problem This Solves
Fixes supported-size images disappearing or throwing a stack overflow when a message is restored to the composer.
User Impact
Users can restore and retry large supported attachments without losing existing failed sends. No persistence-format change, migration, or deletion of legacy queue records is introduced.
Why This Change Was Made
The current editor validator overflows below its 5 MiB limit. In addition, real Gateway transcripts store
media://inbound/...references that the rewind reader was not consuming. This correction shares the existing iterative base64 validator, bounds data-URL parsing to headers, and resolves existing media references through the guarded inbound reader. MIME parameters, malformed-input rejection, size/offload limits, and preview/clone ownership remain intact.This continues @joeykrug's canonical PR. His original head
3affedbd0c5ed8a7f472de53231e888618647cf5remains a parent of the integrated head.Evidence
Current head: 4d4923f.
The previous exact-head CI run completed with 178 passes and eight skips; the only failures were the stale release-inventory count and its aggregate gate. Canonical #150333 is now landed as
8d823fa50ce9, and this head incorporates it without conflicts. All eight attachment production files remain byte-identical to the qualified source; contributor ancestry is preserved. Exact-head CI35162071429 completed successfully: 180 jobs passed and eight skipped, with no failures.The attachment product delta retains the qualified
fb313befbehavior and contributor ancestry. The reviewed Windows Git-owner correction and CI-fixture repairs at85424eccpassed their hosted Windows diagnostic, Linux executor, and line-cap jobs. Current main was integrated without conflicts to qualify the observed merged-source failures.Main has since landed the plugin distribution and catalog corrections (#150316 and #150318). This head adopts those exact landed files, keeping unpublished plugins bundled until release; the temporary exclusion approach is superseded. Generator validation and the changed bundling contract pass. The incremental browser-test correction waits for asynchronous startup and responsive-sidebar settlement without changing product code or weakening diagnostic, clipboard, keyboard or geometry assertions; the focused failing case passes and independent P0–P2 review is clean. A two-line formatting correction fixes the merged-main CI failure.
All eight attachment production owners remain byte-identical to the retained qualified correction. Local types, lint, import cycles and other required static checks passed. The prior CUA failing shard passed hosted on
83fdbc5d; the submenu-focus case passed a focused local investigation but its hosted failure remains recorded for current-head qualification. Current exact-head CI passed; historic failures remain recorded as failures. Fresh ClawSweeper review of this head has no findings or pre-merge requests.49c1bc4d6ee9732b26951ec64e466db670a63ce4: AWS owner/handler regressions fail as expected for supported-size restore and canonical media-reference restoration; malformed-input controls pass.Historical production report and contributor validation remain available in the shipped failure report, queue-preservation decision, and independent prior-head validation.