Repository navigation
fix(media): guard generated video result downloads - #182425
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR guards generated-video result downloads while preserving provider proxy routing, deadlines, retries, size limits, and cleanup. Example: BytePlus returns http://127.0.0.1:41733/video.mp4 as its completed video URL.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this maintainer-authored PR addresses a verified SSRF gap that remains on main; no definite introduced code defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherVideo providers turn completed task URLs into bounded video assets; the shared downloader and provider transport callbacks acquire responses, validate bytes, and release network resources. flowchart TD
A[Video generation request] --> B[Provider task submission and polling]
B --> C[Provider returned result URL]
C --> D[Shared downloader or provider transport callback]
D --> E[SSRF and redirect guard]
E --> F[Bounded video response reader]
F --> G[Generated video asset]
Technical reviewBest possible solution: Retain the existing shared downloader and provider transport callbacks, with strict result-URL checks and complete final-effect evidence. Do we have a high-confidence way to reproduce the issue? Yes: current main routes returned URLs through raw fetch, and yetval's linked report records loopback connections through the production provider path; this review executed no target code. Is this the best way to solve the issue? The repair uses the established asset owner and callback seam, preserves provider routing and bounded response handling, and avoids the public SDK expansion proposed by the earlier closed candidate. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 23f3b4ffcbae. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +92, Tests +266, Docs +6. Total +364 across 9 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed October 24, 2026, 4:40 AM ET / 08:40 UTC. |
|
Merged via squash.
|
(cherry picked from commit 9a97d4c) Adapted for 2026.9.x: ports only the core default-download path in src/media-generation/provider-assets.ts (guarded strict fetch with env-proxy transport, release on rejection) and the shared provider-http test mock. createProviderOperationTimeoutError is exported from the internal src/media-understanding/shared.ts module only; no plugin SDK export is added. The BytePlus and Runway fetchResponse overrides (which need createProviderOperationTimeoutError through openclaw/plugin-sdk/provider-http) and their tests are dropped; on 9.x both providers use the default download path, so they are covered by the core guard with env-proxy transport instead of their configured dispatcher policy. The Runway docs hunk is dropped and the video-generation docs note is reworded to match.
…rust MiniMax video (video_url and file download_url) and music (audio_url) result downloads reused the task's request policy, so request.allowPrivateNetwork granted for a private MiniMax relay also let provider-returned URLs and their redirects reach private hosts. Route them through a strict guarded download that keeps the configured proxy, matching BytePlus and Runway (openclaw#182425).
What Problem This Solves
Fixes: generated-video downloads skip the SSRF guard when a provider task succeeds and returns a result URL or redirects that download.
User Impact
Generated videos from BytePlus, Runway, Together, Novita, Z.AI, and Kie AI are now downloaded only through the guarded network path, so a returned result URL can no longer reach private or internal addresses.
Why This Change Was Made
BytePlus and Runway guarded their task requests, but the returned download URL and its redirects went through a raw fetch, and the shared default downloader exposed Together, Novita, Z.AI, and Kie AI the same way. The shared generated-video asset owner now acquires a guarded response handle in strict mode, keeps download retries, the absolute deadline, HTTP status checks, and byte caps, releases the handle after reading or failure, and the raw response-only path is removed. BytePlus and Runway route through their existing
fetchResponsecallback so they keep their resolved proxy transport, while result downloads inherit neither task credentials nor task-specific private-network trust; MiniMax, xAI, and Vydra already used guarded downloads and are unchanged.Production LOC +104/-12 (net +92); tests +269/-3; test support +2/-2; docs +7/-1. No SDK signature, config key, dependency, schema, or allowed-network policy is added.
Evidence
git diff --checkpassed.Fixes #103083