You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 51fe9b8
Browse filesBrowse the repository at this point in the historyBrowse files
fix: serve OpenRouter's removal rejection for openai/sora-2 (#520)
## Summary
The daily Drift Tests have reported a critical since 2026-10-06 (first
seen in run 37422677099, again in 38030209547 and 38001928761): aimock's
OpenRouter video proxy mirrors the `sora` family, but the live `GET
/api/v1/videos/models` listing no longer has it.
OpenRouter **removed** `openai/sora-2`. It did not just deprecate it.
Under the [deprecation
policy](https://aimock.copilotkit.dev/deprecation-policy/), a removed
model must not mock success. The mock now serves the rejection the real
API returns, and the drift check no longer requires the family.
## What OpenRouter returns now (observed live, 2026-10-10)
- `GET /api/v1/videos/models`: 30 models. None is `openai/sora*`.
Families: aleph, avatar, flux, gen, grok, hailuo, happyhorse, heygen,
kling, seedance, veo, wan.
- `GET /api/v1/models` (458 models): no `sora` id.
- `GET /api/v1/models/openai/sora-2/endpoints`: `404
{"error":{"message":"Not Found","code":404}}`.
- `POST /api/v1/videos` with a valid key and
`{"model":"openai/sora-2","prompt":"a cat","duration":4}`:
```
HTTP/2 400
content-type: application/json
{"error":{"message":"Model openai/sora-2 does not exist","code":400}}
```
That is the same rejection OpenRouter gives an unknown id:
`nonexistent/zzz-1` returns `400 "Model nonexistent/zzz-1 does not
exist"`. No job was created.
## Changes
- `src/openrouter-video.ts`
- New private `OPENROUTER_VIDEO_SUNSET_MODELS = {"openai/sora-2"}`.
- `POST /api/v1/videos` with a sunset model returns the observed 400
body (journaled, `fixture: null`). This happens before fixture matching,
chaos and the record proxy, so no fixture can make it succeed and
nothing goes upstream.
- `DEFAULT_OPENROUTER_VIDEO_MODELS` is now `["bytedance/seedance-2.0"]`.
A fixture for a sunset model no longer adds it to the synthesized
listing.
- `src/__tests__/drift/openrouter-video.drift.ts`
- `REQUIRED_VIDEO_FAMILIES` is now `["seedance"]`. Sora is explicitly
excluded from drift, as the policy requires.
- New live sunset canary: it fails if `openai/sora-2` returns to the
live listing, because then the mock's 400 would be what had drifted.
Mutation check: putting `bytedance/seedance-2.0` in the sunset list
makes the canary fail.
- `src/__tests__/openrouter-video.test.ts`: 4 new sunset tests, written
first and seen failing. The listing-synthesis test now uses
`google/veo-3.1` instead of `openai/sora-2`.
- `src/__tests__/drift/providers.ts`: comment example only.
- `docs/openrouter-video/index.html`: new "Removed Models" section.
`CHANGELOG.md`: loud `[Unreleased] / Changed` entry. This is a normal
release, not a major.
## Local red-green proof
### RED (base `bc436346`, real `OPENROUTER_API_KEY`, live API)
`npx vitest run --config vitest.config.drift.ts --reporter=verbose
src/__tests__/drift/openrouter-video.drift.ts`
```
× OpenRouter video model-family availability (live) > live /api/v1/videos/models contains the families aimock mirrors
1. [critical] aimock's OpenRouter video proxy mirrors the "sora" family, but the live /api/v1/videos/models listing no longer contains it — update DEFAULT_OPENROUTER_VIDEO_MODELS in src/openrouter-video.ts
Path: videos/models/sora
Real: aleph, avatar, flux, gen, grok, hailuo, happyhorse, heygen, kling, seedance, veo, wan
Tests 1 failed | 3 passed (4)
```
Mock before the fix (built `dist`, real HTTP):
```
[no-fixtures] listing=["bytedance/seedance-2.0","openai/sora-2"]
[no-fixtures] POST /api/v1/videos model=openai/sora-2 -> 404 {"error":{"message":"No fixture matched","code":404}}
[sora-fixture] listing=["openai/sora-2"]
[sora-fixture] POST /api/v1/videos model=openai/sora-2 -> 202 {"id":"d90d85fe-…","polling_url":"…","status":"pending"}
```
### GREEN (this branch, same command, same key, live API)
```
✓ OpenRouter video-proxy envelope shapes > submit returns { id, polling_url, status }
✓ OpenRouter video-proxy envelope shapes > completed status poll returns { id, status, unsigned_urls, usage }
✓ OpenRouter video-proxy envelope shapes > models listing returns { data: [ { id, name, supported_* , ... } ] }
✓ OpenRouter video model-family availability (live) > live /api/v1/videos/models contains the families aimock mirrors
✓ OpenRouter video model-family availability (live) > live /api/v1/videos/models still omits the models aimock serves as sunset
Tests 5 passed (5)
```
Mock after the fix:
```
[no-fixtures] listing=["bytedance/seedance-2.0"]
[no-fixtures] POST /api/v1/videos model=openai/sora-2 -> 400 {"error":{"message":"Model openai/sora-2 does not exist","code":400}}
[sora-fixture] listing=["bytedance/seedance-2.0"]
[sora-fixture] POST /api/v1/videos model=openai/sora-2 -> 400 {"error":{"message":"Model openai/sora-2 does not exist","code":400}}
```
## Public type compatibility
- `DEFAULT_OPENROUTER_VIDEO_MODELS` and the new set are module-private.
No exported type changed.
- I diffed `dist/*.d.ts` and `*.d.cts` (172 files) against `npm pack
@copilotkit/aimock@1.45.0` and against a base build. 6 `ws-*` files
differ only in bundler import alias numbering (`node_http2` vs
`node_http3`); they are identical after normalizing that.
`openrouter-video.d.ts` is identical apart from the `sourceMappingURL`
line.
- Consumer proof: a small consumer (`LLMock`, `Fixture`, a video fixture
for `openai/sora-2`) passes `tsc` with `strict` and `skipLibCheck:
false` against both npm 1.45.0 and this branch's build.
## Quality gates (worktree root)
- `pnpm format:check`: pass
- `pnpm lint`: pass
- `pnpm typecheck`: pass
- `pnpm build`: pass
- `pnpm test`: 377 files, 14073 passed, 3 skipped. The first run hit one
timeout in `ws-framing.test.ts` while builds ran at the same time. That
file passed 3 of 3 times on its own, and the full rerun was clean.
## Out of scope
`openai/sora-2-pro` still has an OpenRouter model page, with zero
endpoints, and returns `404 "No endpoints found for
openai/sora-2-pro."`. aimock never mirrored it, so it is not changed
here. OpenAI's direct `/v1/videos` Sora surface is also unchanged.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
3
3
## [Unreleased]
4
4
5
+
### Changed
6
+
7
+
-**OpenRouter Video: `openai/sora-2` now returns the real removal rejection, not a job.** OpenRouter removed the model, and a live submit returns `400 {"error":{"message":"Model openai/sora-2 does not exist","code":400}}`. `POST /api/v1/videos` with `model: "openai/sora-2"` now returns that 400 even when a fixture matches, and never reaches a record-mode upstream. The default `GET /api/v1/videos/models` listing no longer includes `openai/sora-2`, and a fixture for it no longer adds it to the listing. Move fixtures to a model OpenRouter still serves (for example `bytedance/seedance-2.0`). The daily drift check now confirms the model stays absent instead of requiring it.
8
+
5
9
## [1.45.0] - 2026-10-10
6
10
7
11
Every fixture, config and request that 1.44.0 accepted behaves the same by default. New behavior that would change those inputs is opt-in.
0 commit comments