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(gateway): the glm-5.3 family on every relay backend, and base routing that cannot go stale
richard-epsillaaffcd62a379b
diff --git a/gateway/app.py b/gateway/app.pyindex a6ae5aaf..a87bf734 100644--- a/gateway/app.py+++ b/gateway/app.py@@ -4720,7 +4720,7 @@ _MODEL_CATALOG: dict[str, dict] = {"claude-opus-5", "claude-fable-5", "claude-opus-4.8", "claude-sonnet-5","claude-opus-4.7", "claude-sonnet-4.6", "claude-haiku-4.5","gemini-3.6-flash", "deepseek-v4-pro", "deepseek-v4-flash", "kimi-k3",- "kimi-k2.7-code", "mistral-medium-3.5", "step-3.7-flash"]},+ "kimi-k2.7-code", "mistral-medium-3.5", "step-3.7-flash", "glm-5.3", "glm-5.3-flash"]},# cline: same relay reach as opencode/qwen (openai-compatible through the loopback relay,# shape repair in flight). Every row below completed a real turn through the gateway against# the live provider, substitution-checked, in the 2026-08-30 sweep (22/24; the two absentees@@ -4732,7 +4732,7 @@ _MODEL_CATALOG: dict[str, dict] = {"claude-fable-5", "claude-opus-4.8", "claude-sonnet-5", "claude-opus-4.7","claude-sonnet-4.6", "claude-haiku-4.5", "deepseek-v4-pro", "deepseek-v4-flash","kimi-k3", "kimi-k2.7-code", "qwen3.7-max", "qwen3.8-max",- "mistral-medium-3.5", "step-3.7-flash"]},+ "mistral-medium-3.5", "step-3.7-flash", "glm-5.3", "glm-5.3-flash"]},"pi": {"default": "gpt-5.4","models": ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5","gpt-5.4", "gpt-5.4-mini", "gpt-5.2", "gpt-5.3-codex",@@ -4740,7 +4740,7 @@ _MODEL_CATALOG: dict[str, dict] = {"claude-opus-4.7", "claude-sonnet-4.6", "claude-haiku-4.5","gemini-3.6-flash", "deepseek-v4-pro", "deepseek-v4-flash", "kimi-k3","kimi-k2.7-code", "qwen3.7-max", "qwen3.8-max",- "mistral-medium-3.5", "step-3.7-flash"]},+ "mistral-medium-3.5", "step-3.7-flash", "glm-5.3", "glm-5.3-flash"]},}_BARE_MODELS = {"", "claude", "codex", "anthropic", "bedrock", "openai", "hermes", "pi", "dsh", "deepseek"}# Models whose serving CHANNEL refuses image input outright. Measured, not assumed — probed@@ -4843,23 +4843,22 @@ def _backend_of_builtin(harness_id: str) -> str:def _backend_of_harness(hv: dict | None) -> str:- """The backend a harness is pinned to, from its base. Empty when unknown (caller-inferred)."""+ """The backend a harness is pinned to, from its base. Empty when unknown (caller-inferred).++ DERIVED from _BASE_CATALOG, the same way _backend_of_builtin already is, because the+ hand-written if-chain this replaces silently missed qwen: a user-created harness pinned to+ base "qwen" returned "" here, fell through to _route_backend, and gpt-5.4 on that harness+ ran on CODEX — the exact model-name-guessing failure _backend_of_builtin's docstring warns+ about, reintroduced one function up. Found by the SaaS port's review, present since the qwen+ base shipped, and invisible to every sweep because sweeps drive the BUILT-IN harnesses,+ which resolve through the catalog. A new base added to _BASE_CATALOG now routes user+ harnesses with no second edit — the property that would have made the bug inexpressible."""base = str((hv or {}).get("base") or "").lower()- if base == "codex":- return "codex"- if base in ("claude-code", "claude"):- return "claude"- if base == "hermes":- return "hermes"- if base == "cline":- return "cline"- if base == "pi":- return "pi"- if base in ("dsh", "deepseek-harness"):- return "dsh"- if base == "opencode":- return "opencode"- return ""+ if base in ("claude", "claude-code"):+ return "claude" # stored alias: existing harnesses carry either+ if base == "deepseek-harness":+ return "dsh" # legacy display-name base from early dsh harnesses+ return str((_BASE_CATALOG.get(base) or {}).get("backend") or "")def _model_authorized(requested: str, backend: str) -> bool:diff --git a/gateway/tests/test_backend_of_harness.py b/gateway/tests/test_backend_of_harness.pynew file mode 100644index 00000000..bfb2c5ca--- /dev/null+++ b/gateway/tests/test_backend_of_harness.py@@ -0,0 +1,34 @@+"""Every base a user can pin a harness to must route to its backend.++The hand-written if-chain this guards against silently missed qwen: a user-created harness on+that base fell through to model-name guessing, and gpt-5.4 on a qwen harness ran on codex.+Derived-from-the-catalog is the fix; this test is the tripwire that makes the NEXT base unable+to reintroduce the class — it enumerates the catalog rather than naming bases, so it cannot go+stale the way the chain did.+"""+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 A # noqa: E402+++def test_every_catalog_base_routes_a_user_harness():+ for base, entry in A._BASE_CATALOG.items():+ got = A._backend_of_harness({"base": base})+ assert got == entry["backend"], (+ f"a user-created harness pinned to base '{base}' resolves to {got!r}, not "+ f"'{entry['backend']}' — it would fall through to model-name guessing")+++def test_the_stored_aliases_still_resolve():+ assert A._backend_of_harness({"base": "claude"}) == "claude"+ assert A._backend_of_harness({"base": "claude-code"}) == "claude"+ assert A._backend_of_harness({"base": "deepseek-harness"}) == "dsh"+++def test_unknown_base_stays_empty_for_the_caller_to_infer():+ assert A._backend_of_harness({"base": "not-a-base"}) == ""+ assert A._backend_of_harness(None) == ""