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
gateway: TypeSafe AI as a provider for the System One base (#230)
github-actions[bot]75c79e5975dc
diff --git a/docs/self-hosting-guide.md b/docs/self-hosting-guide.mdindex 7b650c22..e6f5ad82 100644--- a/docs/self-hosting-guide.md+++ b/docs/self-hosting-guide.md@@ -335,9 +335,10 @@ problem, because it only offers you providers that work.|---|---|| `anthropic` | Claude Code, Hermes, Pi, DeepSeek Harness, OpenCode, Qwen Code, Cline, Oh My Pi, goose, Kimi Code CLI, Aider, OpenHands || `openai` | Codex, Hermes, Pi, DeepSeek Harness, OpenCode, Qwen Code, Cline, Oh My Pi, goose, Kimi Code CLI, Aider, OpenHands |-| `openrouter` | Codex, Hermes, Pi, DeepSeek Harness, OpenCode, Qwen Code, Cline, Oh My Pi, goose, Kimi Code CLI, Aider, OpenHands |+| `openrouter` | Codex, Hermes, Pi, DeepSeek Harness, OpenCode, Qwen Code, Cline, Oh My Pi, goose, Kimi Code CLI, Aider, OpenHands, System One || `azure-foundry` | Codex, Hermes, Pi, DeepSeek Harness, OpenCode, Qwen Code, Cline, Oh My Pi, goose, Kimi Code CLI, Aider, OpenHands || `google` | Hermes, Pi, DeepSeek Harness, OpenCode, Qwen Code, Gemini CLI, Cline, Oh My Pi, Kimi Code CLI, Aider, OpenHands |+| `typesafe` | System One (Jev on TypeSafe's own API: `jev-latest`, `jev-preview`) || `bedrock` | Claude Code, Hermes || `tokenrouter` | Claude Code, Codex, Hermes, Pi, DeepSeek Harness, OpenCode, Qwen Code, Gemini CLI, Cline, Oh My Pi, goose, Kimi Code CLI, Aider, OpenHands || `vercel` | Claude Code, Codex, Hermes, Pi, DeepSeek Harness, OpenCode, Qwen Code, Cline, Oh My Pi, goose, Kimi Code CLI, Aider, OpenHands |diff --git a/docs/support-matrix-notes.md b/docs/support-matrix-notes.mdindex 721f0aed..ac9d4da4 100644--- a/docs/support-matrix-notes.md+++ b/docs/support-matrix-notes.md@@ -1309,8 +1309,20 @@ normaliser is the passthrough.### The models-`jev-1.13` and `jev-latest`, OpenRouter only (`typesafe/jev-1.13`, `~typesafe/jev-latest`), added to-OpenRouter's vendor table after the shared copy so no other aggregator inherits an id it cannot-serve. No chat model is listed on this base: the loop asks typed questions a text model cannot-answer. TypeSafe's direct endpoint (`/v1/systemone`) is wired in the runner and not yet offered by-the gateway.+Jev under the ids its two providers serve, and nothing across them. OpenRouter: `jev-1.13`+(`typesafe/jev-1.13`, resolving to typesafe/jev-1.13-20260917) and `jev-latest`+(`~typesafe/jev-latest`), added to OpenRouter's vendor table after the shared copy so no other+aggregator inherits an id it cannot serve. TypeSafe AI, the maker's own API (provider `typesafe`,+base `https://api.typesafe.ai/v1`, decisions at `/v1/systemone`, a key checked at `/v1/models`,+401 for a bad one): `jev-latest` (served as jev-1.13.0) and `jev-preview`; `jev-1.13` is "Unknown+model" there (measured 2026-09-20). The base's default is `jev-latest`, the one id both serve, so a+harness made on either connection runs. No chat model is listed on this base: the loop asks typed+questions a text model cannot answer.++**TypeSafe direct, measured 2026-09-20** on a derived image of 37a9159 with a fresh volume and a+native key: the console's integrations route stores the connection with its base filled in and the+key masked; `/v1/bases` shows jev-latest and jev-preview available and jev-1.13 unavailable without+an OpenRouter connection; an order-desk turn on jev-preview completes in 6 actions (6316 in / 1408+out), and on jev-latest the same; a turn on jev-1.13 with only a TypeSafe connection answers 400+`invalid_input`, "no provider configured for backend systemone". The harness alone (`s1 run` with+TYPESAFE_API_KEY) completes the order desk in 5 actions, 0.86 s wall.diff --git a/gateway/app.py b/gateway/app.pyindex 12ae3145..f9291375 100644--- a/gateway/app.py+++ b/gateway/app.py@@ -856,7 +856,7 @@ _BROKER_TTL_S = int(os.environ.get("HR_LLM_BROKER_TTL_S", str(6 * 3600))) # ># transparent to the CLI. bedrock/vertex sign with the cloud SDK and are handled separately# (see _auth_from_conn) — they keep their own credential until their signing path is brokered._BROKERABLE_PROVIDERS = {"anthropic", "tokenrouter", "openai", "azure", "azure-foundry",- "openrouter", "openai-api", "custom", "google"}+ "openrouter", "openai-api", "custom", "google", "typesafe"}# Backends that speak a provider's NATIVE API rather than the OpenAI or Anthropic shape the broker# and the loopback relays carry: nothing sits between the CLI and the provider, so the sandbox@@ -1087,9 +1087,9 @@ _INTEGRATION_WIRING: dict[tuple[str, str], str] = {("anthropic", "openhands"): "anthropic", ("openai", "openhands"): "openai",("azure-foundry", "openhands"): "azure",("openrouter", "openhands"): "openai-api",- # systemone speaks the provider's decisions endpoint through the loopback relay; OpenRouter is- # the one aggregator serving TypeSafe's Jev (beta since 2026-09-18), so it is the one wiring.- ("openrouter", "systemone"): "openrouter",+ # systemone speaks the provider's decisions endpoint through the loopback relay: TypeSafe's own+ # API (/v1/systemone) and OpenRouter, the one aggregator serving Jev (beta since 2026-09-18).+ ("openrouter", "systemone"): "openrouter", ("typesafe", "systemone"): "typesafe",("tokenrouter", "openhands"): "tokenrouter", ("vercel", "openhands"): "tokenrouter",("llmtr", "openhands"): "tokenrouter",("custom", "openhands"): "openai-api",@@ -4491,6 +4491,18 @@ _PROVIDER_CATALOG: dict[str, dict] = {"secret_label": "API Key","key_hint": "sk-or-…",},+ # TypeSafe AI, the maker of Jev: the System One wire on its own API, decisions at /v1/systemone+ # under this base, the same body and answers OpenRouter carries at /api/alpha/decisions. A key+ # is checked at GET /v1/models, which answers 401 for a bad one (measured 2026-09-20). Only the+ # systemone base can use it: it serves no chat model.+ "typesafe": {+ "label": "TypeSafe AI",+ "base_url": "https://api.typesafe.ai/v1",+ "fields": [],+ "secret": "api_key",+ "secret_label": "API Key",+ "key_hint": "apikey_…",+ },"tokenrouter": {"label": "TokenRouter","base_url": "https://api.tokenrouter.com/v1",@@ -5799,6 +5811,11 @@ _VENDOR_MODELS["openrouter"] = {c: _OPENROUTER_RESLUG.get(c, v) for c, v in _SHA# AFTER the shared copy: TokenRouter and Vercel must not inherit an id they cannot serve. Only the# systemone base lists these ids in its catalog, so no chat backend's picker ever shows them._VENDOR_MODELS["openrouter"].update({"jev-1.13": "typesafe/jev-1.13", "jev-latest": "~typesafe/jev-latest"})+# TypeSafe's own API names the same model its own way: `jev-latest` (served as jev-1.13.0, measured+# 2026-09-20) and `jev-preview`, "a preview version of jev-latest". `jev-1.13` is unknown there, so+# the pinned id stays OpenRouter's alone and the preview stays TypeSafe's: a harness resolves the id+# it names through the table of the connection that serves it, and nothing is guessed across them.+_VENDOR_MODELS["typesafe"] = {"jev-latest": "jev-latest", "jev-preview": "jev-preview"}# Vercel's AI Gateway carries the same catalogue under nearly the same slugs, so it starts from# OpenRouter's table too. Only the vendor prefix differs on four of them, and it differs because@@ -6259,10 +6276,13 @@ _MODEL_CATALOG: dict[str, dict] = {"deepseek-v4.1-flash", "qwen3.8-flash", "qwen3.8-27b", "qwen3.7-plus", "hunyuan-4-preview", "nemotron-3.5-lightning", "nemotron-3-super", "grok-4.6", "grok-4.5", "grok-4.3", "grok-4.20", "grok-build-0.1", "muse-spark-1.3", "muse-spark-1.2", "muse-spark-1.1", "muse-glimmer-30b", "llama-4-maverick", "llama-3.3-70b"]},}_MODEL_CATALOG["omp"]["models"] = list(_MODEL_CATALOG["pi"]["models"]) # pi's reach, see the omp entry-# systemone: the two ids OpenRouter serves for Jev, measured live 2026-09-19 (jev-1.13 resolves to-# typesafe/jev-1.13-20260917; jev-latest is OpenRouter's rolling alias of the same). A chat model is-# not offered here: this base asks typed questions and a text model cannot answer them.-_MODEL_CATALOG["systemone"] = {"default": "jev-1.13", "models": ["jev-1.13", "jev-latest"]}+# systemone: Jev's ids across its two providers. `jev-latest` is served by both (TypeSafe's own API,+# and OpenRouter's rolling alias of the same model) and is the default, so a harness made on either+# connection runs; `jev-preview` is TypeSafe's alone and `jev-1.13` OpenRouter's alone (jev-1.13+# resolves to typesafe/jev-1.13-20260917 there; measured 2026-09-19 and 2026-09-20, see+# _VENDOR_MODELS). A chat model is not offered here: this base asks typed questions and a text+# model cannot answer them.+_MODEL_CATALOG["systemone"] = {"default": "jev-latest", "models": ["jev-latest", "jev-preview", "jev-1.13"]}# A pair the matrix failed twice on the one aggregator that serves the id is not offered on that# harness (2026-09-13, five scenarios each): llama-4-maverick on OpenRouter under qwen writes the# tool call as prose; llama-3.3-70b on OpenRouter fails the recall under goose, the artifact underdiff --git a/gateway/tests/test_systemone_catalog.py b/gateway/tests/test_systemone_catalog.pyindex 10caacb0..ddc87c47 100644--- a/gateway/tests/test_systemone_catalog.py+++ b/gateway/tests/test_systemone_catalog.py@@ -1,9 +1,9 @@"""The systemone base: what the catalog promises is what the router can run.-Jev is a decision model served by OpenRouter alone, so its ids live in OpenRouter's vendor table-and no other aggregator's, and only the systemone base lists them. A turn on the base is served-through the one wiring, an OpenRouter integration, and a run that stops for a reason of its own-reports that reason rather than a failure or a step cap.+Jev is a decision model served by TypeSafe's own API and by OpenRouter, each under its own ids,+so those ids live in the two vendor tables and no other's, and only the systemone base lists them.+A turn on the base is served through one of the two wirings, and a run that stops for a reason of+its own reports that reason rather than a failure or a step cap."""import osimport pathlib@@ -13,23 +13,30 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))os.environ.setdefault("HR_BACKING", "local")import app as gw # noqa: E402-JEV = {"jev-1.13": "typesafe/jev-1.13", "jev-latest": "~typesafe/jev-latest"}+JEV_OPENROUTER = {"jev-1.13": "typesafe/jev-1.13", "jev-latest": "~typesafe/jev-latest"}+JEV_TYPESAFE = {"jev-latest": "jev-latest", "jev-preview": "jev-preview"} # measured 2026-09-20+JEV = set(JEV_OPENROUTER) | set(JEV_TYPESAFE)-def test_jev_is_on_openrouter_and_nowhere_else():- for canonical, slug in JEV.items():- assert gw._VENDOR_MODELS["openrouter"][canonical] == slug+def test_jev_is_on_its_two_providers_under_their_own_ids_and_nowhere_else():+ assert {c: gw._VENDOR_MODELS["openrouter"][c] for c in JEV_OPENROUTER} == JEV_OPENROUTER+ assert gw._VENDOR_MODELS["typesafe"] == JEV_TYPESAFE+ assert "jev-1.13" not in gw._VENDOR_MODELS["typesafe"] # "Unknown model" on TypeSafe's API+ assert "jev-preview" not in gw._VENDOR_MODELS["openrouter"] # OpenRouter does not serve the previewfor vendor in ("tokenrouter", "vercel", "llmtr", "openai", "anthropic", "google"):table = gw._VENDOR_MODELS.get(vendor) or {}- assert not (set(JEV) & set(table)), f"{vendor} lists a Jev id it cannot serve"+ assert not (JEV & set(table)), f"{vendor} lists a Jev id it cannot serve"def test_only_the_systemone_base_offers_jev_and_it_offers_nothing_else():- assert gw._MODEL_CATALOG["systemone"] == {"default": "jev-1.13", "models": ["jev-1.13", "jev-latest"]}+ # the default is the one id both providers serve, so a harness made on either connection runs+ assert gw._MODEL_CATALOG["systemone"] == {"default": "jev-latest", "models": ["jev-latest", "jev-preview", "jev-1.13"]}+ assert gw._MODEL_CATALOG["systemone"]["default"] in gw._VENDOR_MODELS["typesafe"]+ assert gw._MODEL_CATALOG["systemone"]["default"] in gw._VENDOR_MODELS["openrouter"]for backend, cat in gw._MODEL_CATALOG.items():if backend == "systemone":continue- assert not (set(JEV) & set(cat.get("models", []))), f"{backend} offers a Jev id it cannot answer"+ assert not (JEV & set(cat.get("models", []))), f"{backend} offers a Jev id it cannot answer"def test_the_base_is_in_the_catalog_with_hard_enforcement_and_no_built_in_tools():@@ -39,12 +46,20 @@ def test_the_base_is_in_the_catalog_with_hard_enforcement_and_no_built_in_tools(assert b["tools"] == [] # the actions are the environment's; nothing is built into the base-def test_an_openrouter_integration_drives_the_base_and_no_other_provider_claims_to():+def test_a_typesafe_or_openrouter_integration_drives_the_base_and_no_other_provider_claims_to():assert gw._INTEGRATION_WIRING[("openrouter", "systemone")] == "openrouter"- others = [k for k in gw._INTEGRATION_WIRING if k[1] == "systemone" and k[0] != "openrouter"]+ assert gw._INTEGRATION_WIRING[("typesafe", "systemone")] == "typesafe"+ others = [k for k in gw._INTEGRATION_WIRING if k[1] == "systemone" and k[0] not in ("openrouter", "typesafe")]assert others == []assert gw._integration_serves_backend({"provider": "openrouter"}, "systemone")+ assert gw._integration_serves_backend({"provider": "typesafe"}, "systemone")assert not gw._integration_serves_backend({"provider": "tokenrouter"}, "systemone")+ # the provider is a plain bearer HTTP API with a fixed base, checked at /v1/models, and it+ # serves no chat model: only the systemone base can use a TypeSafe connection+ ts = gw._PROVIDER_CATALOG["typesafe"]+ assert ts["label"] == "TypeSafe AI" and ts["base_url"] == "https://api.typesafe.ai/v1" and ts["secret"] == "api_key"+ assert "typesafe" in gw._BROKERABLE_PROVIDERS+ assert [b for b in gw._MODEL_CATALOG if gw._integration_serves_backend({"provider": "typesafe"}, b)] == ["systemone"]def test_an_incomplete_turn_status_is_a_response_status_of_its_own():@@ -68,8 +83,8 @@ def test_a_custom_endpoints_models_never_appear_on_the_systemone_list(monkeypatcmonkeypatch.setattr(gw, "_integrations_doc", _integrations)monkeypatch.setattr(gw, "_effective_model_map", _map)assert not gw._custom_can_drive("systemone") and gw._custom_can_drive("claude") and gw._custom_can_drive("hermes")- view = asyncio.run(gw._harness_models_view(None, "systemone", {"jev-1.13", "jev-latest"}))- assert [m["id"] for m in view["models"]] == ["jev-1.13", "jev-latest"]+ view = asyncio.run(gw._harness_models_view(None, "systemone", {"jev-1.13", "jev-latest", "jev-preview"}))+ assert [m["id"] for m in view["models"]] == ["jev-latest", "jev-preview", "jev-1.13"]assert all(m["available"] for m in view["models"])# a chat backend the custom format cannot drive still shows the row, greyed, as the explanationview = asyncio.run(gw._harness_models_view(None, "claude", set()))diff --git a/ui/src/lib/harness.ts b/ui/src/lib/harness.tsindex 28fa200e..01c5b15b 100644--- a/ui/src/lib/harness.ts+++ b/ui/src/lib/harness.ts@@ -155,10 +155,11 @@ export const OOB: OobHarness[] = [systemPrompt: 'You are OpenHands, an autonomous coding agent. You work on a real git workspace with shell and file access, reading and editing files and running commands to complete the task end to end.',tools: [], skills: [] },{ id: 'systemone', name: 'System One', version: 'v0.3.1', backend: 'systemone', status: 'ready',- // Placeholder only: the gateway's catalog wins once fetched. The two ids OpenRouter serves for- // TypeSafe's Jev, a decision model; there is no chat model on this base because the loop asks- // typed questions a text model cannot answer. Measured live 2026-09-19.- models: ['jev-1.13', 'jev-latest'], defaultModel: 'jev-1.13', moreModels: 0,+ // Placeholder only: the gateway's catalog wins once fetched. Jev, a decision model, under the+ // ids its two providers serve: jev-latest on both (the default), jev-preview on TypeSafe's own+ // API, jev-1.13 on OpenRouter. There is no chat model on this base because the loop asks typed+ // questions a text model cannot answer. Measured live 2026-09-19 and 2026-09-20.+ models: ['jev-latest', 'jev-preview', 'jev-1.13'], defaultModel: 'jev-latest', moreModels: 0,systemPrompt: 'You act inside a finite set of actions the environment offers each step. Choose the action that moves the goal forward, finish when the goal is reached, and escalate when nothing offered fits.',tools: [], skills: [] },];