Repository navigation
fix(providers): enforce canonical binary response ownership - #117281
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:35 AM ET / 07:35 UTC. ClawSweeper reviewWhat this changesThe PR validates BytePlus and Runway video downloads plus MiniMax music downloads so non-media or empty successful responses fail clearly and rejected unread streams are canceled. Merge readinessThe patch is still necessary: current main contains the shared binary-response contract, but the three provider-owned download paths still accept HTTP-200 JSON, text, and empty bodies as generated media. The PR applies the existing contract at the correct owner boundaries with focused regression coverage; it remains open because it is current, maintainer-labeled, and exact-head checks are still running. Likely related people: Peter Steinberger (high confidence) and Vincent Koc (high confidence). Priority: P2 Review scores
Verification
How this fits togetherProvider plugins poll a vendor generation API and then download the vendor-owned media URL. The downloaded response is converted into an attachment returned to the agent, so validation must reject non-media content before attachment creation. flowchart LR
A[Generation request] --> B[Provider task API]
B --> C[Generated media URL]
C --> D[Provider download boundary]
D --> E[Binary response validation]
E --> F[Bounded media reader]
F --> G[Agent attachment output]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +42, Tests +229. Total +271 across 8 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused provider-owner repair after exact-head checks complete, keeping the existing per-provider timeout, retry, byte-limit, authentication, and missing-content-type behavior intact. Do we have a high-confidence way to reproduce the issue? Yes, source reproducible: current main's affected download owners accept an HTTP-successful response and return bounded bytes without applying the shared non-text/non-JSON and non-empty binary invariant. The PR body also records a real transport reproduction, but this read-only review did not rerun it. Is this the best way to solve the issue? Yes. Applying the existing canonical binary validator at each provider-owned download boundary is narrower and more maintainable than adding a new shared policy layer, while the local empty-body checks preserve provider-specific timeout and size-limit errors. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against edfeec49e7a7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: (41 commits) test(ci): update memory helper routing expectation (#117295) fix(canvas): emit successful control results in JSON mode (#117297) fix(imessage): settle native inbound reply delivery (#117282) fix(agents): reject invalid UTF-8 LSP responses (#117271) fix(line): centralize card and template message alt text (#117280) fix(release): validate candidates before Docker publication (#117252) fix(media): validate provider-owned generated media downloads (#117281) fix(feishu): restore custom HTTPS API domains (#117278) fix(models): reuse prepared plugin metadata (#117131) fix(agents): stop fallback after delivered-but-failed attempts (#114628) fix(memory): reuse targeted session corpus snapshot (#117247) fix(matrix): reconcile durable sends after response loss test(release): repair full validation regressions (#116931) fix(linux-canvas): report socket watcher fallback (#109502) fix(codex): preserve authoritative turn completion (#117185) fix(canvas): preserve widgets across derived-name collisions (#117132) fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (#117206) fix(msteams): prevent duplicate final replies (#116398) fix(doctor): session SQLite restore installs an empty session index over the valid archive (#117221) fix(plugins): preserve workspace plugins across CLI and control UI (#117265) ...
…aw#117281) Co-authored-by: Peter Steinberger <[email protected]>
* origin/main: (41 commits) test(ci): update memory helper routing expectation (openclaw#117295) fix(canvas): emit successful control results in JSON mode (openclaw#117297) fix(imessage): settle native inbound reply delivery (openclaw#117282) fix(agents): reject invalid UTF-8 LSP responses (openclaw#117271) fix(line): centralize card and template message alt text (openclaw#117280) fix(release): validate candidates before Docker publication (openclaw#117252) fix(media): validate provider-owned generated media downloads (openclaw#117281) fix(feishu): restore custom HTTPS API domains (openclaw#117278) fix(models): reuse prepared plugin metadata (openclaw#117131) fix(agents): stop fallback after delivered-but-failed attempts (openclaw#114628) fix(memory): reuse targeted session corpus snapshot (openclaw#117247) fix(matrix): reconcile durable sends after response loss test(release): repair full validation regressions (openclaw#116931) fix(linux-canvas): report socket watcher fallback (openclaw#109502) fix(codex): preserve authoritative turn completion (openclaw#117185) fix(canvas): preserve widgets across derived-name collisions (openclaw#117132) fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (openclaw#117206) fix(msteams): prevent duplicate final replies (openclaw#116398) fix(doctor): session SQLite restore installs an empty session index over the valid archive (openclaw#117221) fix(plugins): preserve workspace plugins across CLI and control UI (openclaw#117265) ...
…, HTML, or empty bodies Google video, fal video, and fal image provider-owned downloads could report successful generated media when the download actually returned HTTP-200 JSON, problem JSON, HTML, or zero bytes. Sibling providers (BytePlus video, Runway video, MiniMax music) were already covered by openclaw#117281. Add assertProviderBinaryResponseContent before reading each binary body and reject empty bodies so malformed downloads fail loudly instead of surfacing as successful generated media. Cancel each rejected body so the underlying socket is released.
What Problem This Solves
BytePlus video, Runway video, and MiniMax music could report successful generated media when a provider-owned download actually returned HTTP-200 JSON, problem JSON, HTML, or zero bytes. MiniMax's
minimaxandminimax-portalaliases shared the same affected music owner.Why This Change Was Made
Validate the response at each existing provider-owned binary-download boundary with the canonical public provider HTTP validator, reject empty media after the existing bounded reader, and cancel unread invalid response bodies before their transport is released. Preserve provider-specific byte-limit and timeout errors, accepted audio/video/octet-stream/missing media types, request authentication, MiniMax retry behavior, and the recently landed MiniMax streaming-completion and strict-hex handling.
The only shared changes expose the existing real validator through existing test-only mocks; no production Plugin SDK surface, provider policy, configuration, or transport-security contract changes.
User Impact
Generated BytePlus and Runway videos and MiniMax music now fail clearly when an upstream download is not valid nonempty media, instead of returning corrupt or empty successful output. Rejected unfinished response streams release their sockets promptly.
Evidence
51c41c25c8c3fdb9340415b41c8faf1a44c18b45; immutable candidate:240421a0639abb0f641adb432cdd407abb0ef4f5.fetch: baseline reproduced 16 malformed-media successes while 24 valid/cap/strict-hex/stream-completion controls passed; immutable candidate passed all 44 cases across BytePlus, Runway, MiniMax, and MiniMax Portal, with 98 HTTPS requests and 68 real CONNECT tunnels.OPENCLAW_VITEST_FS_MODULE_CACHE=0 OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree node scripts/run-vitest.mjs extensions/byteplus/video-generation-provider.test.ts extensions/runway/video-generation-provider.test.ts extensions/minimax/music-generation-provider.test.ts extensions/minimax/video-generation-provider.test.ts— four files, 65 tests passed.oxfmt --checkacross all eight existing changed files andgit diff --checkboth passed.ee320a6e411479a23faa89a75463ff1b15630afcmerges cleanly into synthetic tree923e2e8fc8eb2b7adb73e448873d68d7054bbdc4.