feat(ai-openrouter): video generation adapter (/api/v1/videos) + image activity follow-ups#740
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
🚀 Changeset Version Preview8 package(s) bumped directly, 23 bumped as dependents. 🟥 Major bumps
🟨 Minor bumps
🟩 Patch bumps
|
|
View your CI Pipeline Execution ↗ for commit 7bb9066
☁️ Nx Cloud last updated this comment at |
@tanstack/ai
@tanstack/ai-anthropic
@tanstack/ai-client
@tanstack/ai-code-mode
@tanstack/ai-code-mode-skills
@tanstack/ai-devtools-core
@tanstack/ai-elevenlabs
@tanstack/ai-event-client
@tanstack/ai-fal
@tanstack/ai-gemini
@tanstack/ai-grok
@tanstack/ai-groq
@tanstack/ai-isolate-cloudflare
@tanstack/ai-isolate-node
@tanstack/ai-isolate-quickjs
@tanstack/ai-mcp
@tanstack/ai-ollama
@tanstack/ai-openai
@tanstack/ai-openrouter
@tanstack/ai-preact
@tanstack/ai-react
@tanstack/ai-react-ui
@tanstack/ai-solid
@tanstack/ai-solid-ui
@tanstack/ai-svelte
@tanstack/ai-utils
@tanstack/ai-vue
@tanstack/ai-vue-ui
@tanstack/openai-base
@tanstack/preact-ai-devtools
@tanstack/react-ai-devtools
@tanstack/solid-ai-devtools
commit: |
0c65cc7 to
acd7319
Compare
…e activity follow-ups Closes #707. - Add openRouterVideo: async jobs adapter for OpenRouter's dedicated video API (submit -> poll -> download). Per-model size/duration/option types are generated from GET /api/v1/videos/models; frame roles map onto frame_images[] / input_references[] per the MediaInputRole taxonomy. - Teach the model-meta sync scripts the videos/models endpoint (openrouter.video-models.json + OPENROUTER_VIDEO_MODEL_META). - Image adapter follow-ups from the #624 review: throw on unmapped sizes (the size union used a Unicode multiplication sign so every non-square size silently dropped its aspect ratio), throw on numberOfImages > 1 (live-verified: the gateway ignores all count keys), expose image_config.strength. - Completed videos are returned as data: URLs (unsigned_urls 401 without the API key header) with gateway-reported cost on usage.cost. The SDK's getVideoContent is bypassed: its matcher only accepts application/octet-stream while the endpoint serves video/mp4. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The getVideoContent response-matcher bug is still present in 0.12.79 (the stream matcher only accepts application/octet-stream while the endpoint serves video/mp4), so the direct unsigned-URL download stays. Link the aimock feature request (CopilotKit/aimock#261) from the e2e matrix exclusion. Submit/poll/download lifecycle re-verified live on the new SDK. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
413f0a7 to
7bb9066
Compare
Important
Blocked by #624 (implements #618) — this PR is stacked on
618-image-to-image-and-image-to-video-supportand stays draft until #624 merges, then gets rebased ontomainand marked ready.🎯 Changes
Implements #707 (follow-up to #618 / #624). Stacked on #624 — based on
618-image-to-image-and-image-to-video-support; rebase ontomainonce that merges.openRouterVideoadapterPOST /api/v1/videos→ pollGET /api/v1/videos/{jobId}→ download) — Seedance 2.0, Veo 3.1, Wan, Kling, Sora 2 Pro through one key, on the same jobs/polling architecture as the Sora adapter.imageInputsrole mapping per the issue table:start_frame/end_frame→frame_images[](first_frame/last_frame),reference/character→input_references[],mask/control→ throw, unroled image → start frame. Frame roles are validated against each model'ssupported_frame_images.videoInputs/audioInputsthrow (unsupported by the API).size/duration/resolution/aspectRatiotypes and runtime validation are generated fromGET /api/v1/videos/models(OPENROUTER_VIDEO_MODEL_META);seed/generateAudioare dropped from the type for models whose metadata reports them unsupported. The sync scripts (fetch-openrouter-models.ts/convert-openrouter-models.ts) now fetch and convert the second endpoint.data:URLs —unsigned_urls401 without the API key header (verified live), so they can't go straight into a<video>tag. Downloads >10 MiB log the same OOM warning as the OpenAI adapter. Gateway-reported cost is surfaced asusage.cost.getVideoContent: its response matcher (as of@openrouter/sdk0.12.35) only acceptsapplication/octet-streamwhile the live endpoint servesvideo/mp4— worth reporting upstream. Download uses a config-injectablefetchseam.Image activity follow-ups (#624 review)
sizenow throws with the supported list. Root cause found: theOpenRouterImageModelSizeByNameunion used the Unicode×(U+00D7) while the lookup table used ASCIIx, so every typed size except1024x1024silently dropped its aspect ratio. Union fixed to ASCII;×still normalized at runtime.numberOfImages > 1now throws. Live-verified: the chat-completions pathway ignores every count key (numberOfImages,num_images,count) and always returns one image. Also confirmedimage_configcasing live: snake_caseaspect_ratiochanges output dimensions, camelCase is silently ignored — comment added at the request site.image_config.strength(0.0–1.0 i2i influence) exposed viamodelOptions.strength.Tests / E2E / Docs
feature-support.ts— aimock 1.29 only mocks the OpenAI-shaped/v1/videos, not OpenRouter'spolling_url/unsigned_urlsjob shape (same constraint noted in feat: multimodal prompt for generateImage/generateVideo (image-to-image, image-to-video) #624).media/video-generation.md,media/image-generation.md,adapters/openrouter.md(+config.jsondates), media-generationSKILL.md, changeset (minor).✅ Checklist
pnpm run test:pr.🚀 Release Impact
🤖 Generated with Claude Code