Skip to content

fix: avoid remote audio downloads for waveform decoration - #156307

Open
vincentkoc wants to merge 1 commit into
mainfrom
fix/control-ui-m8-local-waveform-20260923
Open

vincentkoc wants to merge 1 commit into
mainfrom
fix/control-ui-m8-local-waveform-20260923

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: opening chat downloads remote audio in full just to draw a waveform, before the user chooses to play it.

User Impact

Remote audio keeps its native play, pause and seek controls without the extra waveform-only download. Browser-held blob/data audio still gets a waveform, and already-retained peaks are reused.

Why This Change Was Made

Waveform decoration now uses only browser-held bytes. Source/authentication identity, transcode readiness, bounded decoding and retained Blob cleanup stay with their existing owners.

Original published-head delta: production +8/-10 (net -2), tests +175/-100. That historical version makes the header helper private. The unpublished current-main integration below preserves its export for newer callers.

Provenance: the remote waveform read was introduced in 116115 (d60436a4), authored and merged by @steipete. Native playback is not removed or delayed by this fix.

Evidence

The following completed proof is bound to original published head fb4a15436de00dae96cd8b3f7c14ffe28a6ad668, not the new committed integration.

  • Both remote-source regression cases fail before the fix; 48 owner/sibling cases across four suites pass afterward.
  • Test cost: the 48-case/four-suite focused command reported 6.05s wall time (Vitest 4.76s), excluding lock wait; the outer receipt was 69.61s including the lock queue. Exact-head CI run spans 912s (15m12s) from workflow start to final update, including scheduling/orchestration, not summed execution time. Its parallel checks-ui (1/3), (2/3), and (3/3) jobs span 285s, 335s, and 312s respectively from job start to completion, including setup; these are elapsed job durations, not isolated test or CPU time.
  • Required scoped format, conflict, size, assertion, dependency, localization, type, export, lint, style and whitespace gates pass.
  • Fresh independent review completed with no actionable findings; exact source and proof were independently qualified.
  • Inspected Chromium capture: waveform-only fetches fall from 1 to 0; native play/pause passes in both states, and keyboard seek passes after the fix. No browser errors.
  • Proof uses the actual Control UI audio component with generated audio and a synthetic byte-range HTTP route. It is not deployed-app or authenticated live-Gateway evidence. Native media range requests remain expected.

Before

Waveform decoration performs one extra full-body fetch.

Before: one waveform-only full-body fetch

After

The same playback controls use native media loading with no waveform-only fetch.

After: no waveform-only fetch; native controls retained

Current-Main Integration

Earlier signed integration e1d3cd94bf7b1e25eb22a670488597e6bf3fa28c preserves the original head and frozen main bf2883a22e341cdc0cbbdd60fadfacf505b68c62 as its parents, with tree 953db3edd72db746adc65c6566c3fda6ee790357. It changes only the audio player and its tests relative to that main: production +7/-9, tests +125/-83. Main's newer fixture helpers, bounded reader, disconnect and superseding-player coverage remain intact.

161173, commit 3a9edfe4350f258fe0d8c677e93d61857935c63a, introduced two additional production callers of buildChatMediaFetchHeaders in attachment availability and image loading. The original private-export change would break that integration, so the helper now remains byte-identical to main, including its export. Cache lookup still precedes the browser-held-source guard.

Fresh source AutoReview found no actionable P0-P2 issue in the complete two-file diff. Its other metadata-only passes are not additional source reviews. Parent inspection also verified the helper and both main callers. This is source review, not runtime qualification.

The corrected candidate's first remote composition request was superseded in pending budget slot12 before any runner or test step. Source-backed admission investigation then justified one unchanged-candidate continuation: 37069887456 passed all29 owner/sibling tests (20 player,4 waveform,5 bounded-reader), with zero skips/failures and all18 source pins unchanged. Its aggregate remained failed because the subsequent formatter check found one test-fixture line wrap; no test failure was hidden.

The formatting-only follow-up completed the remote formatter, explicit two-path changed checks and diff check successfully. This includes the eight selected core-test type graphs, UI types, lint, guards and dead-export checks. The exact generated patch changes only one object-literal wrap in the player test (+3/-1), with production unchanged. It is committed as signed unpublished successor 8758eb9d0782833fe7733faef2590cb84378959b, tree c1eb561c5fffda35020e6e5155340645cc5df20c. Parent verified the patch and18 final source pins. The29 behavioral passes remain pre-format evidence on e1d3cd94, reused for this mechanical-only successor; they were not replayed or relabeled as a new test run. Both controllers joined and their exact leases completed. Backing Actions cancellation during successful native cleanup is not an application-proof failure.

Current Native Candidate

The prior signed unpublished native candidate was 67db39c47f7ea745fa9003a5f7dc8fd0748a4833, tree a850e27d7499ebd530be06b69eeba1b6a8b56ff3. It merges the prior 88bf71bf99947f7769199d011a91dc238d249865 correction with verified landed main 5c894c71b889408c0bf583ae4aa08e36129ab3a4, preserving original PR ancestry. The complete two-file main-relative patch is byte-identical. All18 proof inputs are unchanged between main456 and5c;17 original receipt pins match, with only the already-reviewed package-file exclusion reorder differing. Parent and independent review support reusing the scoped proof under its original bindings, not relabeling it new-head execution.

The first full native gate at 8758eb9d passed the full build in6m45s, production/script/root typechecks, and core/script lint. Plugin lint failed at extensions/codex/src/session-catalog-index.ts (723 lines against700). Both that file and the lint configuration were byte-identical to frozen main. The aggregate remains failed, full tests did not start, and no passing gate stamp was written. The controller joined, the exact lease completed, and the failed log was preserved.

Canonical 163806 already repairs that lint failure on main. The integration also contains main's staged UI validator fixture repair. No unrelated subsystem was patched in this PR. Parent and independent review verified the entire two-file waveform delta is byte-identical against the new main base;17 of18 prior proof pins are unchanged. The sole metadata difference only reorders an identical package-file exclusion, leaving dependencies, scripts and all other fields unchanged. Prior scoped proof is retained under its existing bindings, not rerun or relabeled as new-head proof.

The corrected-composition full gate finished FAILED through the same all-remote route. Full build passed in408.2s; production, scripts and root-test types passed in131.31s,43.97s and181.11s. Core lint failed only src/gateway/worker-environments/bootstrap.ts (702 lines against700) and its test (1023 against1000); plugin/script lint passed. Full tests did not run and no passing gate stamp exists. The controller joined, exact lease completed and settled operation lock was recovered natively; the reporting-portal timeout was separate from the actual lint failure.

The bootstrap failure above is historical and repaired by 163959, merged as 5c894c71. The new waveform candidate includes it without changing limits or its own patch. Its third full native remote gate37090935911 has now finished FAILED: full build passed in329.5s; production, scripts and root-test typechecks passed in126.40s,38.97s and161.42s; plugin and script lint passed. Core lint failed only src/agents/subagents/spawn/subagent-spawn.production-boundary.test.ts at1,004 lines against1,000. Full tests did not run and no passing gate stamp was written. The failing test and lint configuration are byte-identical in this candidate, selected main5c and checked current-main checkpoint a41db648dc3de4e1fd26d90ab2d1be179319678c. The test was last modified by 162176; its trusted-host-identity and lineage assertions must be preserved in the canonical size repair. The failed log is retained, controller joined, exact lease completed, and the settled operation lock was recovered natively. Portal reporting timeout is separate from the lint failure. That failed candidate review remains preserved unchanged. The canonical repair and successor admission are recorded below; no cap increase, assertion weakening or inherited-failure waiver. Public head remains fb4a15436de00dae96cd8b3f7c14ffe28a6ad668.

The current signed unpublished candidate is 711a4f2be70190b669d3f5eb0b826d3d19a5a4a0, tree 60c2614248dd0be31247af9517838a25e6f32303, preserving the original 67db39c4 parent and incorporating canonical repair164002 / 5e6794cf. That repair landed with exact-head green CI, a complete39-case owner suite, unchanged lint limits, and no ClawSweeper findings. The waveform's full two-file patch and all18 compared proof inputs remain unchanged from main5c to5e; parent and independent source review admit normal remote gates without replaying the retained29-case/scoped proof. Historical failed gate results keep their original bindings.

Full native remote qualification37094755221 ended failed/incomplete on October3. Build and full checks passed; five completed test groups passed30,961 cases with57 skips. Tooling had not completed, so its passing assertion rows and nested fixture summaries do not establish a full-suite pass. The check job attributes cancellation to blacksmith-sh[bot]: Run Testbox was cancelled at05:15:19UTC, the job completed cancelled at05:20:06, and the native wrapper exited255. No formal assertion failure was captured, but no native success stamp exists. The cancellation reason is unknown; the one check-job log request returned404 BlobNotFound and was not retried or fetched through another route.

The controller joined, exact lease completed, and the settled native operation lock was recovered and verified absent. Source head/tree and clean state stayed exact. The current correction review is NEEDS WORK / tests fail for this incomplete gate; retained scoped proof is not erased. No source push, local application execution or provider change occurred. Next: obtain Blacksmith's cancellation decision for this exact run/job/time, including the triggering threshold and last activity if idle-related, then complete supported missing qualification before publication and exact-head CI. No blanket proof replay, larger limits or gate waiver.

Remaining Before Merge

The original-head CI, attempt 2, failed when the docked-question Collapse action exceeded its 30-second click deadline in job108121461589. Cause and candidate involvement remain unproved. The isolated one-case result and seven-case ordered-prefix result do not recreate the original three-worker shard. Previous log/media retrieval stops remain respected; no alternate retrieval or timeout/assertion change was made.

Under the frozen test-failure policy, that bounded unresolved history remains documented rather than an additional root-cause approval gate. Current affected-test and changed-check proof is complete under the bindings above. Full native remote correction gates, native publication, refreshed head-stamped review and exact resulting-head required CI are still mandatory before squash. The original48-case and visual proof is not relabeled as integration proof.

@vincentkoc vincentkoc self-assigned this Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review September 23, 2026 07:29
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed October 3, 2026, 1:30 AM ET / 05:30 UTC (Revision 11).

ClawSweeper review

What this changes

The Control UI audio player limits new waveform decoding to browser-held audio, updates regression coverage, and makes the media-header helper private.

Merge readiness

⛔ Needs changes before merge - 1 item remains

The fix remains useful: current main still downloads remote audio for waveform decoration. The pinned patch has no discrete correctness finding and has convincing browser proof, but the public branch remains conflicted and the corrected integration is unpublished.

Priority: P2
Reviewed head: fb4a15436de00dae96cd8b3f7c14ffe28a6ad668

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with strong component proof and no discrete pinned-patch finding; integration publication remains outstanding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The pinned audio-player change is exercised in Chromium using the actual component and synthetic HTTP audio: inspected diagnostic captures show waveform-only reads falling from one to zero, with reported play, pause, and seek success. This evidence retains its original public-head binding and does not qualify the unpublished integration. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The pinned audio-player change is exercised in Chromium using the actual component and synthetic HTTP audio: inspected diagnostic captures show waveform-only reads falling from one to zero, with reported play, pause, and seek success. This evidence retains its original public-head binding and does not qualify the unpublished integration. No stored-data contract changes.
Evidence reviewed 9 items Pinned introduced change: Inspected the complete merge-base-to-head patch. The source guard follows cache lookup, restricts new reads to blob/data audio, and leaves playback, bounded reading, source identity, and cleanup with their existing owners.
Still necessary on main: Read the current-main audio player. Its waveform preparation still performs a GET of the ready source without the browser-held-source guard; viewport admission can initiate that work before playback.
Latest-release behavior: GitHub contents inspection of v2026.9.8 confirms waveform preparation still fetches the source at line 308. The requested restriction is therefore absent from both the inspected release and current main.
Findings None None.
Security None None.

How this fits together

The Control UI turns chat audio attachments into inline players. Its source controller prepares playback, while the audio component adds playback controls and optional waveform decoration.

flowchart TD
  A[Chat audio attachment] --> B[Playback source controller]
  B --> C[Native audio playback]
  B --> D[Waveform cache lookup]
  D --> E[Browser-held audio check]
  E -->|Local bytes| F[Bounded waveform decoding]
  E -->|Remote source| G[Plain seek controls]
  F --> H[Waveform seek controls]
Loading

Before merge

  • Complete next step (P2) - Complete the documented native qualification, publish the export-preserving current-main integration, and refresh review against the resulting public head.
Agent review details

Security

None.

PR surface

Source -2, Tests +75. Total +73 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 8 10 -2
Tests 1 175 100 +75
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 183 110 +73

Review metrics

None.

Technical review

Best possible solution:

Keep waveform decoration limited to browser-held bytes while preserving current main's shared header export, native playback, cache ownership, and media recovery behavior.

Do we have a high-confidence way to reproduce the issue?

Yes, the source establishes the path: a visible audio card with eligible duration metadata can fetch its remote source for waveform decoding before play. The supplied Chromium comparison demonstrates that component behavior; this review did not execute current main.

Is this the best way to solve the issue?

Yes, restricting decoration at the audio-player owner is a narrow repair that preserves native media loading. The final integration must retain the shared header export needed by current-main callers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9c4a75fa73fa.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Avoiding redundant audio downloads is a bounded Control UI performance improvement with working native playback.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The pinned audio-player change is exercised in Chromium using the actual component and synthetic HTTP audio: inspected diagnostic captures show waveform-only reads falling from one to zero, with reported play, pause, and seek success. This evidence retains its original public-head binding and does not qualify the unpublished integration. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The pinned audio-player change is exercised in Chromium using the actual component and synthetic HTTP audio: inspected diagnostic captures show waveform-only reads falling from one to zero, with reported play, pause, and seek success. This evidence retains its original public-head binding and does not qualify the unpublished integration. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The pinned audio-player change is exercised in Chromium using the actual component and synthetic HTTP audio: inspected diagnostic captures show waveform-only reads falling from one to zero, with reported play, pause, and seek success. This evidence retains its original public-head binding and does not qualify the unpublished integration. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: Inspected the complete merge-base-to-head patch. The source guard follows cache lookup, restricts new reads to blob/data audio, and leaves playback, bounded reading, source identity, and cleanup with their existing owners. (ui/src/pages/chat/components/chat-audio-player.ts:300, fb4a15436de0)
  • Still necessary on main: Read the current-main audio player. Its waveform preparation still performs a GET of the ready source without the browser-held-source guard; viewport admission can initiate that work before playback. (ui/src/pages/chat/components/chat-audio-player.ts:308, 9c4a75fa73fa)
  • Latest-release behavior: GitHub contents inspection of v2026.9.8 confirms waveform preparation still fetches the source at line 308. The requested restriction is therefore absent from both the inspected release and current main. (ui/src/pages/chat/components/chat-audio-player.ts:308, fc23bc864e45)
  • Inspected browser proof: Viewed both downloaded GitHub screenshots. The real audio component's diagnostic counter changes from one extra waveform full-body read to zero, and the after capture shows playback at 0:04 with the seek control retained. The body describes Chromium playback, pause, and keyboard-seek checks against generated audio served through a synthetic byte-range HTTP route, bound to the pinned public head. This proves the component boundary, not an authenticated deployed Gateway. (ui/src/pages/chat/components/chat-audio-player.ts:300, fb4a15436de0)
  • Regression coverage: Read the complete player suite and waveform, source-controller, bounded-reader, and playback-coordinator owners. The added remote cases exercise viewport admission and play without a waveform fetch; blob/data cases retain decoding and authentication-scoped cache coverage. Reported focused proof is 48 cases across four suites in 6.05 seconds wall time; no tests were executed during this read-only review. (ui/src/pages/chat/components/chat-audio-player.test.ts:299, fb4a15436de0)
  • Current-main integration requirement: Current main imports the shared header helper from attachment availability and image loading. The public patch makes it private, while the body explicitly describes an unpublished integration that preserves its export. GitHub still reports the original public head as dirty and unmergeable; no pinned test merge is available, so this review does not claim a specific merged-result regression. (ui/src/pages/chat/components/chat-media-playback.ts:24, 9c4a75fa73fa)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Publish the export-preserving current-main integration after its documented qualification, then refresh source review against the resulting public head while retaining original proof bindings.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-25T14:55:05.549Z sha fb4a154 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-02T22:00:36.428Z sha fb4a154 :: blocked before merge. :: none
  • reviewed 2026-10-02T22:26:05.254Z sha fb4a154 :: blocked before merge. :: none
  • reviewed 2026-10-02T23:02:48.185Z sha fb4a154 :: blocked before merge. :: none
  • reviewed 2026-10-02T23:30:19.560Z sha fb4a154 :: blocked before merge. :: none
  • reviewed 2026-10-03T02:58:51.450Z sha fb4a154 :: blocked before merge. :: none
  • reviewed 2026-10-03T03:17:42.553Z sha fb4a154 :: blocked before merge. :: none
  • reviewed 2026-10-03T04:02:51.698Z sha fb4a154 :: blocked before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

This branch has not been deployed

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

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant