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
nemotron-3-super is declared text only, and OpenRouter's 404 for an image is read as the refusal it is (#603)
github-actions[bot]9ab97dee3402
diff --git a/gateway/app.py b/gateway/app.pyindex c2b141e0..4e1fabbe 100644--- a/gateway/app.py+++ b/gateway/app.py@@ -8486,7 +8486,12 @@ _BARE_MODELS = {"", "claude", "codex", "anthropic", "bedrock", "openai", "hermes# a degraded answer beats a dead conversation. dsh, omp and fast-agent read the same flag (fast-agent# keeps an image in its history under the model that attached it; the runner takes it out of the# stored conversation before a text-only model loads it).-_TEXT_ONLY_INPUT = {"qwen3.7-max", "glm-5.3", "nemotron-3.5-lightning"}+# 2026-10-27, nemotron-3-super, one image part through the test instance's own connections (and on the hosted+# service's Vercel route after a deck agent had looked at its slides):+# Vercel -> 400 "This model doesn't support the image content block that you provided."+# OpenRouter -> 404 "No endpoints found that support image input"+# The same request without the image answered on both.+_TEXT_ONLY_INPUT = {"qwen3.7-max", "glm-5.3", "nemotron-3.5-lightning", "nemotron-3-super"}# Union of BOTH tables' values — a dict merge would drop the bedrock ids (shared keys, anthropic# values win), silently rejecting the us.anthropic.* ids this set exists to allow._PROVIDER_CLAUDE_IDS = {v.lower() for v in [*_BEDROCK_CLAUDE.values(), *_ANTHROPIC_CLAUDE.values()]}diff --git a/gateway/tests/test_text_only_input.py b/gateway/tests/test_text_only_input.pynew file mode 100644index 00000000..71f63b6d--- /dev/null+++ b/gateway/tests/test_text_only_input.py@@ -0,0 +1,17 @@+"""The models whose channels take no image input (_TEXT_ONLY_INPUT): the runner's `vision` flag is false for them, so+pi, dsh, omp and fast-agent keep images out of what they send (fast-agent's overlay declares text only, its stored+history is stripped), as the relay's image fit does. Each entry was measured refusing an image."""+import os+import pathlib+import sys++sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))+os.environ.setdefault("HR_BACKING", "local")+import app as gw # noqa: E402+++def test_the_measured_text_only_models():+ # nemotron-3-super (2026-10-27): Vercel 400 "This model doesn't support the image content block", OpenRouter+ # 404 "No endpoints found that support image input"; the same request without the image answered on both+ assert gw._TEXT_ONLY_INPUT == {"qwen3.7-max", "glm-5.3", "nemotron-3.5-lightning", "nemotron-3-super"}+ assert "glm-5.3-flash" not in gw._TEXT_ONLY_INPUT # took the same image task and completeddiff --git a/runner/server.py b/runner/server.pyindex 6525bdb5..7af8831e 100644--- a/runner/server.py+++ b/runner/server.py@@ -4642,13 +4642,20 @@ _IMAGES_CAP_SEEN: dict[tuple[str, str], int] = {}_IMAGES_LIMIT_RE = re.compile(rb"(?:number of images|images?)\b[^0-9\"]{0,60}?(?:maximum|max|limit|more than|up to|at most)"rb"[^0-9\"]{0,20}?(\d{1,4})", re.I)_IMAGES_NONE_RE = re.compile(rb"doesn't support the image|does not support (?:the )?image|not support(?:s|ed)? (?:image|vision)"- rb"|image input is not supported|Unexpected item type in content", re.I)+ rb"|image input is not supported|Unexpected item type in content"+ rb"|No endpoints found that support image input", re.I)+# OpenRouter says a model takes no image with a 404, "No endpoints found that support image input" (nemotron-3-super+# and nemotron-3.5-lightning, 2026-10-26/27), where the others answer 400; the rung reads all of them.+_IMAGES_REFUSED_STATUS = (400, 404, 413, 422)_IMAGE_NOT_SENT = "[An image from earlier in this conversation is not shown here.]"_IMAGE_TEXT_ONLY = "[An image is not shown here: this model reads text only.]"def _is_image_part(x: object) -> bool:- return isinstance(x, dict) and x.get("type") in _IMAGE_PARTS and (x.get("type") != "image" or "source" in x)+ # `type` is read as a string only: a tool's JSON schema may have a property named `type`, whose value is a+ # schema object, and a dict there failed the lookup and with it the whole request (0.37.5 to 0.37.6)+ t = x.get("type") if isinstance(x, dict) else None+ return isinstance(t, str) and t in _IMAGE_PARTS and (t != "image" or "source" in x)def _image_cap(model: str, route: tuple[str, str]) -> int | None:@@ -6110,7 +6117,7 @@ class _HermesRelayHandler(http.server.BaseHTTPRequestHandler):# A refusal of the conversation's images (none taken, or more than the model's limit):# learned for this route and sent once more with the images it takes. Any other# refusal goes on to the repairs below.- sent_images = _image_count(body) if attempt < 2 and e.code in (400, 413, 422) else 0+ sent_images = _image_count(body) if attempt < 2 and e.code in _IMAGES_REFUSED_STATUS else 0allowed = _images_refused(data) if sent_images else Noneif allowed is not None and allowed < sent_images:_IMAGES_CAP_SEEN[image_route] = min(allowed, _IMAGES_CAP_SEEN.get(image_route, allowed))diff --git a/runner/tests/test_relay_images.py b/runner/tests/test_relay_images.pyindex 3d1333be..f7f1d5d6 100644--- a/runner/tests/test_relay_images.py+++ b/runner/tests/test_relay_images.py@@ -21,6 +21,8 @@ QWEN_SAYS = ("<400> InternalError.Algo.InvalidParameter: The provided messages i"The error info is [Unexpected item type in content.].")NEMOTRON_SAYS = "This model doesn't support the image content block that you provided. Update the content block and try again."MISTRAL_SAYS = "Total number of images exceeds the maximum allowed of 8."+# OpenRouter's answer for a model with no image-capable endpoint: a 404 (nemotron-3-super, 2026-10-27)+OPENROUTER_SAYS = "No endpoints found that support image input"PNG = "data:image/png;base64,iVBORw0KGgo="@@ -55,6 +57,8 @@ def test_each_wording_is_read_and_nothing_else_is():assert server._images_refused(_err(QWEN_SAYS)) == 0assert server._images_refused(_err(NEMOTRON_SAYS)) == 0assert server._images_refused(_err(MISTRAL_SAYS)) == 8+ assert server._images_refused(_err(OPENROUTER_SAYS)) == 0+ assert 404 in server._IMAGES_REFUSED_STATUSassert server._images_refused(_err("max_tokens: 100000 > 64000, which is the maximum allowed")) is Noneassert server._images_refused(_err("invalid temperature: only 1 is allowed")) is Noneassert server._images_refused(b"") is None@@ -91,9 +95,12 @@ def test_a_body_within_the_limit_goes_byte_for_byte():# ── through the relay, against an upstream that refuses as Vercel's routes did ──────────────────────────────-def _vercel_like(doc: dict) -> bytes | None:- """The refusal Vercel's route gave for this request on 10-27, or None when it answers."""+def _vercel_like(doc: dict) -> bytes | tuple | None:+ """The refusal Vercel's route gave for this request on 10-27, or None when it answers; (status, body) for+ OpenRouter's 404."""n, m = server._image_count(json.dumps(doc).encode()), str(doc.get("model"))+ if "unlisted-text-model" in m and n:+ return 404, _err(OPENROUTER_SAYS)if "qwen3.7-max" in m and n:return _err(QWEN_SAYS)if "nemotron" in m and n:@@ -118,7 +125,9 @@ def upstream(monkeypatch):got.append(raw)doc = json.loads(raw)refused = _vercel_like(doc)- if refused is not None:+ if isinstance(refused, tuple):+ code, out = refused+ elif refused is not None:code, out = 400, refusedelif self.path.endswith("/responses"):code, out = 200, json.dumps({"id": "resp_1", "object": "response", "status": "completed", "model": doc["model"],@@ -183,3 +192,32 @@ def test_a_model_that_takes_images_is_sent_all_of_them_and_other_refusals_pass_tassert post("/responses", _responses(2, "meta/llama-4-maverick")) == 400# not about images: no fitted resend (the relay's other repairs may still try their own)assert all(server._image_count(b) == 2 for b in got[1:])+++def test_a_text_only_model_no_list_names_is_learned_from_openrouters_404(upstream):+ post, got = upstream+ assert post("/chat/completions", _chat(2, "acme/unlisted-text-model")) == 200 and len(got) == 2+ assert server._image_count(got[0]) == 2 and server._image_count(got[1]) == 0+ assert post("/chat/completions", _chat(2, "acme/unlisted-text-model")) == 200+ assert len(got) == 3 and server._image_count(got[2]) == 0 # learned for the route+++def test_a_tool_with_a_property_named_type_is_walked_without_failing():+ """0.37.7-rc.1: dcode's follow-up was refused (400), the rung counted the request's images, and a tool whose+ parameters had a property named `type` (a schema object, so a dict where a part's type string sits) raised+ TypeError: the relay dropped the connection and the turn failed with "Connection error"."""+ body = _responses(2, "nvidia/nemotron-3-super")+ body["tools"] = [{"type": "function", "name": "write_todos", "parameters": {"type": "object", "properties": {+ "type": {"type": "string", "enum": ["image", "text"]}, "items": {"type": "array", "items": {"type": "object",+ "properties": {"type": {"type": "string"}}}}}}}]+ raw = json.dumps(body).encode()+ assert server._image_count(raw) == 2+ out = json.loads(server._fit_images(raw, 0))+ assert server._image_count(json.dumps(out).encode()) == 0 and out["tools"] == body["tools"]+++def test_a_refusal_not_about_images_on_such_a_body_reaches_the_client(upstream):+ post, got = upstream+ body = _responses(2, "meta/llama-4-maverick")+ body["tools"] = [{"type": "function", "name": "f", "parameters": {"type": "object", "properties": {"type": {"type": "string"}}}}]+ assert post("/responses", body) == 400 # the provider's own answer, not a dropped connection