Repository navigation
refactor(ui): remove obsolete chat media plumbing - #139346
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper re-review Current head: 907a9a6. The follow-up fixes the two URL-mock lint findings without changing production code. All 23 media lifecycle cases and targeted lint pass; the unchanged dashboard case also passed in isolation. The PR body contains the full cleanup evidence and final LOC totals. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 5:16 PM ET / 21:16 UTC. ClawSweeper reviewWhat this changesRemoves unused browser preview-folder state and consolidates attachment availability arguments and media test fixtures without changing intended chat behavior. Merge readiness✅ Ready for maintainer review Keep open as a useful, distinct cleanup following the merged image-continuity fix. The reviewed refactor preserves media authorization and invalidation behavior; no actionable introduced defect was found. Priority: P3 Review scores
Verification
How this fits togetherControl UI renders chat attachments using authenticated Gateway metadata and short-lived media tickets. Session and configuration changes invalidate browser resources, while the Gateway decides whether each file may be served. flowchart TD
A[Chat attachments] --> B[Browser media resources]
C[Session and configuration changes] --> B
B --> D[Authenticated metadata request]
D --> E[Gateway file access policy]
E --> F[Media ticket or denial]
F --> G[Preview or unavailable card]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -108, Tests -288. Total -396 across 33 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one server-owned media authorization path and reuse the existing browser policy invalidation and resource lifecycle. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR removes obsolete plumbing rather than claiming a new bug fix; source comparison supports the stated equivalence. Is this the best way to solve the issue? Yes: removing the unused browser state and migrating internal callers together is narrower than retaining a parallel folder list or introducing another authorization abstraction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fcebd5d5a19b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper status |
|
🦞👀
|
|
Merged via squash.
|
* refactor(ui): simplify chat media availability and lifecycle tests * test(ui): return URL mocks from the media fixture
Related: #139323
What Problem This Solves
Chat media still carried a browser-side preview-folder list through Gateway bootstrap, application config, panes, transcripts, and sidebars after preview authorization moved to the Gateway. That unused state retained redundant invalidation logic and test scaffolding. Availability and retry paths also repeated the same credential, session, policy, and callback arguments.
Why This Change Was Made
Remove the unused
localMediaPreviewRootsfield end to end. The Gateway continues to derive allowed folders from current session/config state; the browser continues to revalidate through the existing media policy key. Availability and retry now accept the shared render-options object and use one resource lookup, preserving their existing cache keys and callback ownership.Consolidate repeated pane, ticket-response, and Blob-URL fixtures without dropping the 23 media-lifecycle cases. Remove the single 129-line test that enforced obsolete bootstrap-root propagation; retain the actual session-permission and configuration-driven denial/restoration tests. No new caches, flags, compatibility paths, or dependencies.
User Impact
Preserves the uploaded-image continuity fix and existing attachment behavior while reducing the state and code needed to maintain it. Uploads remain visible through worktree hydration and history handoff. Permission changes still trigger server checks, and explicit denial still removes a preview.
Evidence
de2c4b1768d9with the pinned dependency setup. Both cases passed in the warmed candidate rerun with unchanged timeout and auth assertions.check:changedgate passed in an isolated normal checkout with its own pinned install; all 33 edited files match this commit.Before cleanup
After cleanup