Repository navigation
fix(control-ui): audio and video replies show a download card when playback metadata is missing - #197290
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. |
|
Codex review: needs maintainer review before merge. What this changesManaged audio and video attachments without playback metadata use the Gateway’s existing playback route. Example: An assistant sends a three-second AIFF while ffprobe is unavailable during publication.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a verified playback failure still present on current main, with convincing browser proof and no actionable findings. Exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe attachment resolver supplies playback sources to inline players, the Files sidebar, and the video gallery; the Gateway owns inspection, conversion, and authorized byte delivery. flowchart LR
A[Assistant media attachment] --> B[Attachment source resolver]
B --> C[Inline player or Files or gallery]
C --> D[Gateway playback route]
D --> E[Inspect and prepare rendition]
E --> F[Original or playable media bytes]
F --> C
Technical reviewBest possible solution: Land the focused resolver fallback after the existing exact-head CI gate passes. Do we have a high-confidence way to reproduce the issue? The publication and resolver sources establish the failure path, and supplied built-Gateway Chromium traces reproduce it with a synthetic AIFF; this read-only review ran no target code. Is this the best way to solve the issue? This is the smallest complete fix: preserve authoritative playback metadata and route unknown managed media through the existing preparation owner shared by the affected UI consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7154e4efb11b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests -5, Docs +1. Total +1 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource stale. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 11, 2026, 1:28 PM ET / 18:28 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Proof with a built Gateway and the built Control UI in real Chromium (Playwright), in Docker (node:24.22.1 with Debian ffmpeg 5.1). Main is How the AIFF lost its playback information: a stand-in model replied
On main, the Gateway's playback route does convert the same metadata-less AIFF: a direct External (non-managed) links: their source check is unchanged ( UI bundle: the changed chunk Changes on top of the contributor commit: removed the test-lines allocation. The fixtures that model probed native files now share one Before (main) and after (fix) screenshots of the metadata-less AIFF reply are attached below. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Head is now |
|
Landed in 62f42dc. Thanks @masatohoshino. |
…ayback metadata is missing (openclaw#197290) fix(ui): play assistant media that arrives without playback metadata When the Gateway published an assistant audio or video attachment without playback information, because its media check failed or the inspector was busy, the Control UI treated the file as natively playable. For formats a browser cannot play, such as AIFF, Ogg, FLAC, AMR and AVI, it showed a download card instead of using the Gateway's converting playback route, which Apple clients already use (openclaw#191517). Attachments without playback information now go through the playback route; attachments marked native or transcode, and external media links, are unchanged. No new UI text. Chat attachment chunk gzip grows by 16 B. Evidence: a built Gateway and the built Control UI in real Chromium on node:24.22.1 with ffmpeg. A stand-in model replied with an AIFF while ffprobe was missing, so the Gateway's check really failed and the attachment was stored without playback information. On main the chat showed a download card and the browser fetched the original audio/aiff; with this change it shows the inline player, the playback route returns audio/mp4 and the clip plays. A transcode-marked AIFF, native MP3s and a native MP4 behave the same on both. Before and after screenshots: openclaw#197290 (comment). Tests are -5 net. Details: openclaw#197290 (comment). Closes openclaw#197289. Thanks @masatohoshino. Co-authored-by: Ayaan Zaidi <[email protected]>


Closes #197289
What Problem This Solves
Fixes: the Control UI shows a download card instead of a player for assistant audio or video in a transcode-only format (AIFF, Ogg, FLAC, AMR, AVI, ...) when the Gateway published the reply without
playbackmetadata, which happens when its media inspector is busy or a probe fails.User Impact
User impact: such replies now play inline in the Control UI. When the metadata is missing, the Control UI asks the Gateway's playback route, which inspects the file then and either converts it or serves the original bytes. Apple clients have done the same since #191517.
Why This Change Was Made
resolveAttachmentSourcedecides the playback mode for every attachment consumer: the inline audio player, the Files sidebar and the video gallery. Before this change it defaulted a missing value tonative. It now defaults managed outgoing media (/api/chat/media/outgoing/...) totranscode, matching the Apple fallback in #191517. Explicitplaybackmetadata still wins, and non-managed sources keepnative.playback: "native", the field the Gateway sets after a successful probe. Those fixtures share one constant, so the net test change is −5 (no allocation).docs/nodes/media-playback.mdnow names the Control UI next to Apple clients.nativedefault (ChatMediaPlayer.kt). This change is limited to the Control UI, because Android needs its own device proof.Evidence
Maintainer proof (built Gateway and Control UI in Chromium, the AIFF published while ffprobe was unavailable, main and fix plus controls): #197290 (comment). Screenshots: #197290 (comment)
Tested at
7347f442a3a948cdecab6539cf87fa47bad2607c(baseupstream/main04e941df29283d3c7a2e770c552a464e465f47ad).Both builds ran the same steps. Each built checkout started one isolated Gateway through
openclaw qa suite --provider-mode mock-openai, using a one-off flow scenario that was not committed:chat.sendturn. The mock provider replied withMEDIA:<workspace>/playback-qa-clip.aiff, a synthetic 3-second 440 Hz sine AIFF.ffprobefailed on purpose (a shim in front of the real binary). The realffprobeandffmpeghandled every later request. This produces the same history block as a busy inspector: a managedaudioblock,audio/aiff, with noplaybackfield.openclaw-chat-audio-playerstate, then took a screenshot of the reply.Before (base
04e941df292):After (this PR):
Observed result: with the same history block, the base read the original AIFF and fell back to the download card. The PR asked the playback route, waited for the rendition, and loaded a playable 3-second M4A.
Checks:
pnpm test <file> --maxWorkers=1. Wall times are in the table below.test/tsconfig/tsconfig.core.test.ui-chat.json.check-test-lines-ratchetagainst the base,oxfmt --checkon the changed files, andgit diff --checkagainst the base.chat-message-attachment-source.test.tsand passes on this branch.--maxWorkers=1wallui/src/pages/chat/components/chat-message-attachment-source.test.tsui/src/pages/chat/components/chat-message.attachments.test.tsxui/src/pages/chat/components/chat-video-gallery-source.test.tsui/src/pages/chat/chat-pane-embedded-panels.test.tsReview: autoreview (Codex
gpt-6.1-sol, thinking high, threshold P1) on base04e941df29283d3c7a2e770c552a464e465f47adand head7347f442a3a948cdecab6539cf87fa47bad2607creturnedscoped-cleanwith 0 findings. Priorities below P1 were not assessed. Apr-simplifypass made no edits: the change is one expression at the existing owner and adds no new path. Against the merge base it adds 5 production lines and 1 docs line; tests are net −5.Not covered:
PlaybackInspectionBusyErrorproduces the same history block, but it was not triggered here.