OpenRouter video: POST /api/v1/videos returns 200, but the official SDK only accepts 202
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, openapi, typescript
調査の方向性
dist/openrouter-video.js の handleOpenRouterVideoCreate から始め、fixture のパスと、それを模倣する record/proxy のパスを調べてください。@openrouter/sdk で呼び出しを再現し、動画の作成が既存のレスポンスボディとともに 202 を返し、ポーリングとダウンロードは変更されないことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Summary
The OpenRouter video mock added for #261 answers job creation (POST /api/v1/videos) with HTTP 200. The official @openrouter/sdk accepts only 202 for that call, so every job created through the real SDK fails before polling starts.
Poll (GET /api/v1/videos/{id}) and download (GET /api/v1/videos/{id}/content) work correctly.
Versions
@copilotkit/aimock1.43.0@openrouter/sdk0.13.20 and 1.4.21 (same behavior in both)
Reproduce
import { LLMock } from '@copilotkit/aimock'
import { OpenRouter } from '@openrouter/sdk'
const mock = new LLMock({ port: 4099, host: '127.0.0.1' })
mock.onVideo('a guitar being played in a store', {
video: { id: 'job-1', status: 'completed', url: 'https://example.com/v.mp4' },
})
await mock.start()
const client = new OpenRouter({
apiKey: 'test',
serverURL: 'http://127.0.0.1:4099/api/v1',
})
await client.videoGeneration.generate({
videoGenerationRequest: {
model: 'google/veo-3.1-lite',
prompt: 'a guitar being played in a store',
},
})
Actual
The SDK throws:
OpenRouterDefaultError: Unexpected Status or Content-Type: Status 200
Body: {"id":"e8c64b76-…","polling_url":"http://127.0.0.1:4099/api/v1/videos/e8c64b76-…","status":"pending"}
The body is correct. Only the status code is rejected.
Expected
202 Accepted with the same body.
Why 202
The SDK is generated from OpenRouter's OpenAPI spec, and its response matcher for this operation lists 202 as the only success status (esm/funcs/videoGenerationGenerate.js):
M.match(
M.json(202, models.VideoGenerationResponse$inboundSchema),
M.jsonErr(400, …), M.jsonErr(401, …), M.jsonErr(402, …),
M.jsonErr(404, …), M.jsonErr(429, …), M.jsonErr(500, …),
M.fail("4XX"), M.fail("5XX"),
)
This is unchanged between SDK 0.13.20 and 1.4.21.
Where
In dist/openrouter-video.js, the create handler (handleOpenRouterVideoCreate) ends with res.writeHead(200, { "Content-Type": "application/json" }). The fixture path and, if it mirrors the upstream status, the record/proxy path should both send 202.
Impact
TanStack AI cannot add openrouter to its video-gen e2e matrix with the built-in handler. The adapter uses the official SDK, so creation fails on the status code. We are keeping OpenRouter video on unit tests until this is fixed (TanStack/ai#1541).
- 主要言語
- TypeScript
- スター
- 979
- フォーク
- 84
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 58
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CopilotKit/aimock のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
CopilotKit/aimock#549 ·
メンテナーはふだん 1 日以内に返信
-
Feature: model-generated files (inline images) in chat/responses turns対応中かも @abhiaiyer91 が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
CopilotKit/aimock#548 ·
メンテナーはふだん 1 日以内に返信
-
Feature: scriptable citations / annotations on text responses対応中かも @abhiaiyer91 が 1 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
CopilotKit/aimock#547 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
CopilotKit/aimock#544 ·
メンテナーはふだん 1 日以内に返信
-
Feature request: provider-native model listing, required-header validation, and non-chat endpoints (Anthropic / Gemini)対応中かも @jpr5 が 6 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 14/100
CopilotKit/aimock#519 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
CopilotKit/aimock の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
OpenPetsHQ/openpets#273 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
fritzprix/libr-agent#2161 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
blackboardsh/electrobun#581 ·
-
backlog-skill effort:xs frontend infra ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
LucasSantana-Dev/Lucky#2862 ·
メンテナーはふだん 1 日以内に返信