Repository navigation
feat(video): add Alibaba Wan 2.6 text-to-video - #2643
Conversation
Add the Alibaba (DashScope) wan2.6-t2v text-to-video model as a first
video-generation integration for the Alibaba provider.
- packages/models: add the wan-2-6-t2v model (video output, per-second
pricing for 720p/1080p, supported sizes/durations, audio always on)
- gateway: createAlibabaVideoJob submits an async DashScope video task
(POST /api/v1/services/aigc/video-generation/video-synthesis with the
X-DashScope-Async header) and base-URL/dispatcher wiring
- worker: fetchAlibabaStatus polls GET /api/v1/tasks/{task_id}, maps
task_status -> canonical status and surfaces the direct video_url
Defaults to the international DashScope endpoint
(dashscope-intl.aliyuncs.com).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughAdds Alibaba (DashScope) video-generation support: registers a new video model, implements gateway-side async job creation and routing to Alibaba, and adds worker-side status polling that normalizes task status, progress, result URLs, and errors. Also updates content-filter signals and tests for Alibaba moderation messages. ChangesAlibaba Video Generation Provider
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0d4809657
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case "alibaba": | ||
| return "https://dashscope-intl.aliyuncs.com"; |
There was a problem hiding this comment.
Honor Alibaba's configured region endpoint
When an Alibaba key is configured for us-virginia or cn-beijing via the existing LLM_ALIBABA_REGION/alibaba_region support, this new video path still submits to the Singapore endpoint. Alibaba documents that the endpoint URL and API key must belong to the same region (cross-region calls fail), so video generation will be broken for users whose chat/image Alibaba setup works in a non-default region. The worker has the same hard-coded default for polling, so the fix needs to resolve the provider's region endpoint consistently for creation and status checks.
Useful? React with 👍 / 👎.
Alibaba/DashScope Wan video moderation rejects prompts with "Green net check failed for input text". Add that signal to the content-filter detector so the failed video job is logged as content_filter instead of upstream_error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Adds video generation via Alibaba (DashScope) to the gateway, starting with the text-to-video model
wan-2-6-t2v(wan2.6-t2v). This is the first video integration for the existing Alibaba provider; only text-to-video is wired up for now.What changed
packages/models— newwan-2-6-t2vmodel (output: ["video"],videoGenerations: true) with:$0.08/s(720p) and$0.12/s(1080p)1280x720 / 720x1280 / 1920x1080 / 1080x1920and durations2–15ssupportsVideoAudio: true,supportsVideoWithoutAudio: false) — DashScope auto-dubs wan2.6 output and exposes no disable toggletest: "skip"so it is excluded from the default e2e suiteapps/gateway/src/videos/videos.ts—createAlibabaVideoJobsubmits an async DashScope task viaPOST /api/v1/services/aigc/video-generation/video-synthesiswith theX-DashScope-Async: enableheader and{ model, input.prompt, parameters.{size,duration} }body (size converted to DashScopeW*Hformat). Added the dispatcher case and the default base URL.apps/worker/src/services/video-jobs.ts—fetchAlibabaStatuspollsGET /api/v1/tasks/{task_id}, mapsoutput.task_status(PENDING/RUNNING/SUCCEEDED/FAILED) to the canonical status and surfaces the directoutput.video_url. Alibaba is excluded from the/v1/videos/{id}/contentmetadata fetch since DashScope returns a direct OSS URL.Defaults to the international endpoint
https://dashscope-intl.aliyuncs.com(matching the existing Alibaba chat default). Uses the existingLLM_ALIBABA_API_KEYcredential — no new env/provider setup required.Testing
pnpm formatandpnpm buildpasspnpm vitest run packages/models/src/providers.spec.ts apps/gateway/src/lib/alibaba-pricing.spec.ts— 153 passedNotes / follow-ups (out of scope)
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Content & Moderation
Tests
Integration