HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
feat(media): prefer the Vercel gateway for video, speech and images
richard-epsilla2016a66e78bb
diff --git a/gateway/media_catalog.json b/gateway/media_catalog.jsonindex 90f99d52..70493e2a 100644--- a/gateway/media_catalog.json+++ b/gateway/media_catalog.json@@ -46,6 +46,29 @@"text_to_video": {"unit": "clip","candidates": [+ {+ "model": "bytedance/seedance-2.5",+ "provider": "vercel",+ "shape": "vercel-video",+ "params": [+ "prompt",+ "duration",+ "size"+ ],+ "in": [+ "text"+ ],+ "out": [+ "video"+ ],+ "resolution": "854x480",+ "accepts_input_image": false,+ "duration_observed_s": 5.056,+ "latency_s": 116.0,+ "usd": 0.5182759,+ "measured": "verified e2e 2026-08-16 against the live gateway on the Future HR key: asked for 5 s at 480p and got back a presigned url to a 3,617,186 byte mp4, 854x480, h264 with an aac track it was not asked for. It HONOURS duration (5 asked, 5.056 delivered), unlike the tokenrouter seedance entry. Cost is the gateway's own number from providerMetadata.gateway.cost, not an estimate: $0.5182759 for those 48,437 completion tokens. Took 116 s inside the submit, so it is synchronous and never enters the poll walk.",+ "verification": "verified"+ },{"model": "dreamina-seedance-2-5-hc","provider": "tokenrouter",@@ -228,29 +251,6 @@"video"],"verification": "verified_prior"- },- {- "model": "bytedance/seedance-2.5",- "provider": "vercel",- "shape": "vercel-video",- "params": [- "prompt",- "duration",- "size"- ],- "in": [- "text"- ],- "out": [- "video"- ],- "resolution": "854x480",- "accepts_input_image": false,- "duration_observed_s": 5.056,- "latency_s": 116.0,- "usd": 0.5182759,- "measured": "verified e2e 2026-08-16 against the live gateway on the Future HR key: asked for 5 s at 480p and got back a presigned url to a 3,617,186 byte mp4, 854x480, h264 with an aac track it was not asked for. It HONOURS duration (5 asked, 5.056 delivered), unlike the tokenrouter seedance entry. Cost is the gateway's own number from providerMetadata.gateway.cost, not an estimate: $0.5182759 for those 48,437 completion tokens. Took 116 s inside the submit, so it is synchronous and never enters the poll walk.",- "verification": "verified"}]},@@ -327,6 +327,26 @@"unit": "image","$order": "Ordered by latency, not by prestige: an image here is almost always a FRAME on the way to a video, so a 91-second model at the head of the chain turns a four-shot storyboard into six minutes of waiting.","candidates": [+ {+ "model": "openai/gpt-image-1-mini",+ "provider": "vercel",+ "shape": "image-generation",+ "params": [+ "prompt",+ "n",+ "size"+ ],+ "in": [+ "text"+ ],+ "out": [+ "image"+ ],+ "resolution": "1024x1024",+ "latency_s": 20.0,+ "measured": "verified e2e 2026-08-16 against the live gateway on the Future HR key: the EXISTING image-generation shape works unchanged here, because /v1/images/generations is what it already posts. Returned b64_json which decoded to a 1,286,643 byte PNG, 1024x1024.",+ "verification": "verified"+ },{"model": "google/gemini-3.1-flash-lite-image","provider": "tokenrouter",@@ -553,26 +573,6 @@"excluded_reason": "Fails silently AND bills. Never selectable; kept in the file so nobody re-adds it.","measured": "e2e run 2026-08-15 confirmed it again, and this entry is why availability is asserted on a MEDIA PAYLOAD and never on a 200: a status code would read this model as working, on every call, for as long as it kept billing. read_submit enforces that for all five shapes, so a sibling cannot do the same quietly.","verification": "verified"- },- {- "model": "openai/gpt-image-1-mini",- "provider": "vercel",- "shape": "image-generation",- "params": [- "prompt",- "n",- "size"- ],- "in": [- "text"- ],- "out": [- "image"- ],- "resolution": "1024x1024",- "latency_s": 20.0,- "measured": "verified e2e 2026-08-16 against the live gateway on the Future HR key: the EXISTING image-generation shape works unchanged here, because /v1/images/generations is what it already posts. Returned b64_json which decoded to a 1,286,643 byte PNG, 1024x1024.",- "verification": "verified"}]},@@ -687,6 +687,33 @@"unit": "line","$order": "A READER FIRST, then the two that answer. The gpt-audio pair are conversational models doing narration: 'Say: hello.' returned 'Hello! It's great to talk with you.' They stay in the chain because they are a real fallback for a line of speech, and they carry `answers_prompts` so the code sends them the read-aloud instruction they need and warns the agent about the one defect they have. Ranking them first was never a preference \u2014 it was the only option there was. Neither does SSML, voice cloning or word timing.","candidates": [+ {+ "model": "openai/tts-1",+ "provider": "vercel",+ "shape": "vercel-speech",+ "params": [+ "prompt",+ "voice"+ ],+ "in": [+ "text"+ ],+ "out": [+ "audio"+ ],+ "voices": [+ "alloy",+ "echo",+ "fable",+ "onyx",+ "nova",+ "shimmer"+ ],+ "format": "mp3",+ "latency_s": 3.0,+ "measured": "verified e2e 2026-08-16 against the live gateway on the Future HR key: returned base64 audio in a JSON body (NOT raw bytes like the elevenlabs shapes), which decoded to a 26,880 byte mp3, 1.68 s, 24 kHz mono, warnings empty.",+ "verification": "verified"+ },{"model": "eleven_multilingual_v2","provider": "elevenlabs",@@ -734,33 +761,6 @@"measured": "e2e run 2026-08-15 against the live account, through the ordinary chain: POST /v1/text-to-speech/{voice_id} answered 200 with 23449 raw bytes of audio/mpeg \u2014 a 1.437 s mp3 in 1.880 s \u2014 for the 23-character line 'Hello from the gateway.' in George's voice. It READ the line; nothing was answered. Listed in GET /v1/models. Cost 6 characters of the 64945 budget (provider's own /v1/usage/character-stats), which is LESS than the line is long \u2014 so the budget is not one-character-per-character on this tier and nothing here pretends to know the rate. No `usd` for the same reason as the music entry.","verification": "verified"},- {- "model": "openai/tts-1",- "provider": "vercel",- "shape": "vercel-speech",- "params": [- "prompt",- "voice"- ],- "in": [- "text"- ],- "out": [- "audio"- ],- "voices": [- "alloy",- "echo",- "fable",- "onyx",- "nova",- "shimmer"- ],- "format": "mp3",- "latency_s": 3.0,- "measured": "verified e2e 2026-08-16 against the live gateway on the Future HR key: returned base64 audio in a JSON body (NOT raw bytes like the elevenlabs shapes), which decoded to a 26,880 byte mp3, 1.68 s, 24 kHz mono, warnings empty.",- "verification": "verified"- },{"model": "openai/gpt-audio-mini","provider": "tokenrouter",diff --git a/gateway/tests/test_media_mcp.py b/gateway/tests/test_media_mcp.pyindex 71328f4f..29d63a4e 100644--- a/gateway/tests/test_media_mcp.py+++ b/gateway/tests/test_media_mcp.py@@ -20,6 +20,7 @@ from __future__ import annotationsimport astimport asyncioimport base64+import copyimport jsonimport osimport subprocess@@ -1235,8 +1236,13 @@ def test_the_catalog_is_read_from_disk_and_not_compiled_in(tmp_path, monkeypatchsays so. Same rule as kits and skills."""assert Path(media_plane._CATALOG_PATH).name == "media_catalog.json"doc = json.loads(Path(media_plane._CATALOG_PATH).read_text())- assert doc["capabilities"]["text_to_video"]["candidates"][0]["model"] == \- "dreamina-seedance-2-5-hc", "the owner's preferred model is no longer rank 1"+ # The owner's preference moved to the Vercel gateway on 2026-08-16, deliberately: it is the+ # connection with the credits on it, and its seedance HONOURS a requested duration where the+ # relay's ignores it. The relay's entry is still in the chain, one rank down, because it+ # renders well and a second route is the point of a chain.+ t2v = [c["model"] for c in doc["capabilities"]["text_to_video"]["candidates"]]+ assert t2v[0] == "bytedance/seedance-2.5", "the owner's preferred model is no longer rank 1"+ assert "dreamina-seedance-2-5-hc" in t2v, "the previous rank 1 was deleted rather than demoted"swapped = tmp_path / "cat.json"swapped.write_text(json.dumps({"providers": {}, "capabilities": {}}))monkeypatch.setattr(media_plane, "_CATALOG_PATH", str(swapped))@@ -1272,12 +1278,39 @@ def test_nothing_is_skipped_for_being_marked_broken(client, harness, session, prassert out["model"] == "dreamina-seedance-2-5-hc"+def _catalog_with_first(cap_name: str, cand: dict) -> dict:+ """The real catalog with one candidate lifted to rank 1.++ For a test whose subject is a model that is deliberately NOT the default choice. Reordering+ here rather than editing the catalog keeps the test about the model's behaviour instead of+ about which model the owner currently prefers, which is a decision that will move again.+ """+ doc = copy.deepcopy(json.loads(Path(media_plane._CATALOG_PATH).read_text()))+ c = doc["capabilities"][cap_name]["candidates"]+ doc["capabilities"][cap_name]["candidates"] = (+ [x for x in c if x["model"] == cand["model"]] ++ [x for x in c if x["model"] != cand["model"]])+ return doc++def test_the_model_that_ignores_a_duration_says_so_rather_than_being_believed(client, harness,- session, provider):- """Measured: 1 s was asked for and a 6.08 s clip came back. It stays rank 1 — it renders, and- it renders well — but nothing downstream may assume the length it was asked for."""- cand = media_plane.capability("text_to_video")["candidates"][0]- assert cand["model"] == "dreamina-seedance-2-5-hc" and cand["duration_ignored"] is True+ session, provider,+ monkeypatch):+ """Measured: 1 s was asked for and a 6.08 s clip came back. It is no longer rank 1 — the Vercel+ seedance took that slot and HONOURS a duration — but it is still in the chain, so the rule it+ exists for is still live: nothing downstream may assume the length it was asked for.++ Found BY NAME rather than by rank. Asserting a quirk of one model through whatever happens to+ sit at position 0 is how a re-ranking silently stops testing the quirk.+ """+ cands = media_plane.capability("text_to_video")["candidates"]+ cand = next(c for c in cands if c["model"] == "dreamina-seedance-2-5-hc")+ assert cand["duration_ignored"] is True+ # The model that displaced it must NOT claim the same quirk, or the note below is wrong for it.+ assert not cands[0].get("duration_ignored"), \+ f"{cands[0]['model']} is rank 1 and ignores duration — the honest-note path needs revisiting"+ # Drive the chain to THIS candidate for the end-to-end half, since rank 1 is now another model.+ monkeypatch.setattr(media_plane, "catalog", lambda: _catalog_with_first("text_to_video", cand))assert "duration_min_s" not in cand and "durations_s" not in cand, ("an ignored duration must not be written down as a limit — that would skip the model")out = _ok(_call(client, _cred(harness, session), "generate_video",@@ -1441,14 +1474,22 @@ def test_a_size_the_model_cannot_be_told_is_not_reported_as_though_it_were(cliendef test_the_model_that_rejects_an_input_image_is_not_in_the_image_chain():- """It rejects an input image url outright. Listing it in image_to_video would spend the rank-1- slot of a capability with NO substitute on a model that cannot do it at all."""+ """They reject an input image url outright. Listing one in image_to_video would spend the+ rank-1 slot of a capability with NO substitute on a model that cannot do it at all.++ Both seedance entries are checked, not just the top one: the Vercel model that now leads+ text_to_video is text-only too, so the rule has two subjects rather than one.+ """assert [c["model"] for c in media_plane.capability("image_to_video")["candidates"]] == ["kling-v3", "kling-v2-6"]- t2v = media_plane.capability("text_to_video")["candidates"][0]- assert t2v["model"] == "dreamina-seedance-2-5-hc"- assert t2v["accepts_input_image"] is False- assert media_plane.can_serve(t2v, {"image": "…"}), "it would have taken an image job"+ t2v = media_plane.capability("text_to_video")["candidates"]+ textonly = [c for c in t2v if c["model"] in ("dreamina-seedance-2-5-hc",+ "bytedance/seedance-2.5")]+ assert len(textonly) == 2, "a seedance entry vanished from the text chain"+ for cand in textonly:+ assert cand["accepts_input_image"] is False+ assert media_plane.can_serve(cand, {"image": "…"}), \+ f"{cand['model']} would have taken an image job"@pytest.mark.parametrize("cap", ["text_to_video", "image_to_video"])