OpenRouter video: POST /api/v1/videos returns 200, but the official SDK only accepts 202
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, openapi, typescript
Hướng nghiên cứu
Bắt đầu tại dist/openrouter-video.js ở handleOpenRouterVideoCreate và kiểm tra đường dẫn fixture cùng đường dẫn record/proxy mà nó mô phỏng. Tái hiện lệnh gọi bằng @openrouter/sdk và xác minh rằng việc tạo video trả về 202 với phần thân phản hồi hiện có, trong khi polling và tải xuống vẫn không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- TypeScript
- Star
- 979
- Fork
- 84
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 75
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CopilotKit/aimock
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
CopilotKit/aimock#549 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature: model-generated files (inline images) in chat/responses turnsCó thể đã có người làm @abhiaiyer91 đã nhận 4 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
CopilotKit/aimock#548 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature: scriptable citations / annotations on text responsesCó thể đã có người làm @abhiaiyer91 đã nhận 4 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
CopilotKit/aimock#547 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dependency DashboardĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
CopilotKit/aimock#289 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CopilotKit/aimock
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
paperclipai/paperclip#17151 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
AgoraIO-Extensions/agent-infra#3159 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
blocklist addition
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
MetaMask/eth-phishing-detect#304596 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
friction
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
kentcdodds/kody#4142 ·
-
[Bug] Statistics | Task statistics are always empty on MikroORM with MySQL or SQLiteCó thể đã có người làm @NdekoCode đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ever-co/ever-gauzy#11214 ·
Maintainer thường phản hồi trong vòng 1 ngày