Skip to content

fix(web): preserve file attachments when editing queued runs - #9928

Open
saphid wants to merge 4 commits into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:fix/v2-client-file-attachments-20260905
Open

fix(web): preserve file attachments when editing queued runs#9928
saphid wants to merge 4 commits into
pingdotgg:t3code/codex-turn-mappingfrom
saphid:fix/v2-client-file-attachments-20260905

Conversation

@saphid

@saphid saphid commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Saving an edited queued message silently dropped newly added generic files. Include those files in saveability, capability checks, upload completion, and serialization, and preserve file-only drafts when the queued run starts.

At WebSocket intake, claim newly pending uploads into durable thread storage for queued edits. Preserve existing IDs; failed dispatch cleans only new copies while retaining retry sources. Successful client saves release only the new pending uploads.

Verified in the attached web preview: add release-notes.txt, save, and reopen. The pre-fix UI loses the file; the fixed UI retains it. The authoritative saved message contains the durable 53-byte file reference. Both clients used the same disposable V2 backend and real prepared/queued commands; no provider ran during the captured save flow. Before: the two web files from b9fa1399c. After: patch-identical #9928 6e5d34b52, integrated at fa6a1ab04.

Before: the newly added file is missing after reopening

After: release-notes.txt remains attached after reopening

Clean save-and-reopen video · Annotated save-and-reopen video

Annotated screenshots

lost-image-annotated.png

retained-image-annotated.png

Validation: server attachment/WS tests (12), web draft tests (105), earlier focused attachment/UI tests (144), server/web/React Native typechecks, and targeted lint passed. The interaction proof packet validated successfully. Uploaded media was fetched successfully; local recordings and contact sheets were inspected. Web verifies the shared desktop UI; Electron-shell behavior was not separately exercised.

Targets Julius’s V2 branch in #2829. A direct Claude Opus 5 high reviewer launch exited 1 before model execution because OAuth expired; no Claude review occurred.

Implemented and verified with GPT-6 in Codex/T3, with a Codex worker reviewing queued-file ownership.

Current-base verification

Updated to exact V2 base 415ed0f73b97f1655b6282492f81d0b2bba3a9cc at head 5d22ab6bc5c65f5169e32ba553010963da0c7adc. The original leaf plus this base synthesizes cleanly as tree 562831b891f22f33ed9a41a339d4a6773f068821; current V2 base does not contain durable pending-upload claims or generic-file-aware draft saveability, so the fix is not superseded.

  • 115/115 focused server attachment and web draft-store tests pass across two files.
  • Server and web typechecks pass.
  • Targeted lint and diff checks pass. Reported warnings in ChatView.tsx and an unrelated draft-store test line predate this contribution.
  • The six-file contribution is patch-identical to the prior reviewed head. As previously documented, its ws.ts comparison also incorporates upstream project-deletion handling separately from attachment claims.
  • The first refreshed-head CI run passed all 3,899 web tests, then failed on a late unrelated cancelAnimationFrame is not defined worker exception from fileEditorHighlight.test.ts. Repository permissions denied a failed-job rerun, so the final empty child commit retriggers CI without changing the source patch.

Existing recorded attachment persistence evidence retains its original patch-identical revision and scope. No fresh browser or Electron-shell run was performed. Fresh independent Claude review remains unavailable because OAuth is signed out; no Claude review is claimed. Refreshed by GPT-6 in the Codex harness.

@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Sep 5, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Macroscope has since reviewed this pull request. An earlier review was skipped by a cost limit; a review has now completed, so that notice no longer applies.

@github-actions github-actions Bot added the size:XXL 1,000+ changed lines (additions + deletions). label Sep 5, 2026
@saphid
saphid force-pushed the fix/v2-client-file-attachments-20260905 branch from 08f28b9 to 6e5d34b Compare September 5, 2026 05:07
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Sep 5, 2026
@saphid
saphid marked this pull request as ready for review September 5, 2026 06:51
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 6e5d34b

Macroscope's review found this PR approvable — This is a bounded bug fix that extends the existing attachment upload and claim lifecycle to queued-run edits, preserving existing attachments while leaving text-only edits unchanged. The added server cleanup and client upload handling are covered by focused tests and do not alter product defaults or schemas.

No code changes detected at 3c1ed73. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant