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
A Google AI Studio key can be saved; qwen drops gpt-5.3-codex; a failed turn's error line prints once (#83)
github-actions[bot]29edfd3c9d38
diff --git a/gateway/app.py b/gateway/app.pyindex d9a48546..f8de9f28 100644--- a/gateway/app.py+++ b/gateway/app.py@@ -3858,6 +3858,18 @@ _PROVIDER_CATALOG: dict[str, dict] = {"secret_label": "API Key","key_hint": "vck_…",},+ # Google AI Studio: #71 wired the provider (broker base, harness wiring, vendor models) but not+ # this table, and the integrations document is validated against this table on every write, so+ # a Gemini key was refused with "integration needs a name and a known provider (got 'google')"+ # on 0.13.7 (measured while wiring the support matrix, 2026-09-06).+ "google": {+ "label": "Google AI Studio",+ "base_url": "https://generativelanguage.googleapis.com/v1beta/openai",+ "fields": [],+ "secret": "api_key",+ "secret_label": "API Key",+ "key_hint": "AIza…",+ },"llmtr": {"label": "LLMTR","base_url": "https://llmtr.com/v1",@@ -5001,12 +5013,16 @@ _MODEL_CATALOG: dict[str, dict] = {"kimi-k2.7-code", "qwen3.7-max", "qwen3.8-max","mistral-medium-3.5", "step-3.7-flash"]},# qwen-code speaks OPENAI_BASE_URL/OPENAI_API_KEY at the same relays; serving paths are pi's.- # Unprobed per-model on this backend (one live turn each of qwen3.7-max and gpt-5.4 verified,- # 2026-08-25) — substitution-check before leaning on any single row.+ # Measured on the self-hosted instance, 2026-09-06 support matrix (five scenarios per pair):+ # every row below passed on TokenRouter, Vercel and Azure OpenAI. gpt-5.3-codex is NOT here:+ # qwen speaks chat/completions only and gpt-5.3-codex is served on the Responses API alone, so+ # its text turns answer but its first tool turn is refused on every channel (TokenRouter+ # "404 This model is not supported in the v1/chat/completions endpoint", Azure "400 The+ # requested operation is unsupported"). Same rule cline earned for it on 2026-08-30."qwen": {"default": "qwen3.7-max","models": ["qwen3.7-max", "qwen3.8-max","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",+ "gpt-5.4", "gpt-5.4-mini", "gpt-5.2","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",diff --git a/gateway/tests/test_catalog_chat_only_backends.py b/gateway/tests/test_catalog_chat_only_backends.pynew file mode 100644index 00000000..d4c2609f--- /dev/null+++ b/gateway/tests/test_catalog_chat_only_backends.py@@ -0,0 +1,22 @@+"""A model served on the Responses API alone is not offered on a harness that speaks chat/completions only."""+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++RESPONSES_ONLY = {"gpt-5.3-codex"}+CHAT_ONLY_BACKENDS = ("qwen", "cline")+++def test_responses_only_models_stay_off_chat_only_harnesses():+ for backend in CHAT_ONLY_BACKENDS:+ listed = set(gw._MODEL_CATALOG[backend]["models"])+ assert not (listed & RESPONSES_ONLY), f"{backend} lists {listed & RESPONSES_ONLY}"+++def test_the_harnesses_that_speak_responses_keep_it():+ for backend in ("codex", "hermes", "pi", "dsh", "opencode"):+ assert "gpt-5.3-codex" in gw._MODEL_CATALOG[backend]["models"]diff --git a/gateway/tests/test_google_provider_catalog.py b/gateway/tests/test_google_provider_catalog.pynew file mode 100644index 00000000..f79f941c--- /dev/null+++ b/gateway/tests/test_google_provider_catalog.py@@ -0,0 +1,20 @@+"""A Google AI Studio key is a provider the integrations document accepts, not only one the broker knows."""+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_every_wired_provider_is_in_the_catalog_the_document_is_validated_against():+ wired = {p for (p, _backend) in gw._INTEGRATION_WIRING}+ missing = wired - set(gw._PROVIDER_CATALOG)+ assert not missing, f"wired but refused on write: {missing}"+++def test_google_carries_its_key_field_and_endpoint():+ g = gw._PROVIDER_CATALOG["google"]+ assert g["secret"] == "api_key" and g["base_url"].startswith("https://generativelanguage.googleapis.com")+ assert "gemini-3.6-flash" in gw._VENDOR_MODELS["google"]diff --git a/scripts/support-matrix/run.mjs b/scripts/support-matrix/run.mjsindex d6d3f25d..c617bb92 100644--- a/scripts/support-matrix/run.mjs+++ b/scripts/support-matrix/run.mjs@@ -59,7 +59,8 @@ async function turn(text, { maxS = 420, expectFiles = false } = {}) {let st = '';for (let i = 0; i < maxS / 3; i++) { await sleep(3000); const dr = await door(); if (dr) return { ok: false, s: secs(), tail: '', why: 'door: ' + dr.slice(0, 160) }; d = await detailOf(sid); st = String(d?.turn_status || d?.status || ''); if (TERMINAL.has(st)) break; }let last = null, turns = null;- for (let i = 0; i < 10; i++) { turns = await turnsOf(sid); last = turns && turns.length > n0 ? turns[turns.length - 1] : null; const stored = !!(last && TERMINAL.has(String(last.status)) && (last.assistant || last.error || last.incomplete_reason || (last.files || []).length)); if (stored && (!expectFiles || (last.files || []).length)) break; await sleep(3000); }+ // the record must be THIS message's: a send refused at the door leaves the previous turn's record in place+ for (let i = 0; i < 10; i++) { turns = await turnsOf(sid); last = turns && turns.length > n0 && String((turns[turns.length - 1] || {}).user || '').trim() === text.trim() ? turns[turns.length - 1] : null; const stored = !!(last && TERMINAL.has(String(last.status)) && (last.assistant || last.error || last.incomplete_reason || (last.files || []).length)); if (stored && (!expectFiles || (last.files || []).length)) break; await sleep(3000); }// then let the console render what the server storedconst head = String(last?.assistant || '').replace(/\s+/g, ' ').trim().slice(0, 40);for (let i = 0; i < 12; i++) { const t = await transcript(); const from = t.lastIndexOf(mark); if (!/Working…/.test(t.slice(from)) && (!head || t.slice(from).includes(head))) break; await sleep(1500); }@@ -126,7 +127,15 @@ try {log(`RECYCLE ${k} ${rec.recycle.ok ? 'ok' : 'FAIL'} ${rec.recycle.s}s ${rec.recycle.why}`);} else { rec.followup = { ok: null, why: 'first turn failed' }; rec.switch = { ok: null, why: 'first turn failed' }; rec.artifact = { ok: null, why: 'first turn failed' }; rec.recycle = { ok: null, why: 'first turn failed' }; }} catch (e) { rec.error = String(e).slice(0, 300); log(`ERROR ${k} ${rec.error}`); if (/has been closed/.test(rec.error)) throw e; } // a closed browser ends the worker; the next launch resumes- const all = load(); all[k] = rec; save(all); log(`PAIR_DONE ${k}`);+ // the record is complete: stamp the connection that served it, then let the session go. Its+ // workspace, checkpoint and trace are of no further use, and 170 of them per provider filled+ // a 62 GB disk (hr-oss-test, 2026-09-06).+ if (rec.sid) {+ const d = await page.evaluate(async (sid) => { const r = await fetch(`/api/harness/v1/sessions/${sid}`); return r.ok ? await r.json() : null; }, rec.sid).catch(() => null);+ if (d && d.last_connection) rec.connection = String(d.last_connection);+ rec.deleted = await page.evaluate(async (sid) => { const r = await fetch(`/api/harness/v1/sessions/${sid}`, { method: 'DELETE' }); return r.status; }, rec.sid).catch(() => 0);+ }+ const all = load(); all[k] = rec; save(all); log(`PAIR_DONE ${k} connection=${rec.connection || '?'} deleted=${rec.deleted || '?'}`);}}} catch (e) { log(`FATAL ${String(e).slice(0, 300)}`); }diff --git a/ui/src/lib/conversation.ts b/ui/src/lib/conversation.tsindex 79a83ea3..9ccc3163 100644--- a/ui/src/lib/conversation.ts+++ b/ui/src/lib/conversation.ts@@ -37,6 +37,15 @@ export interface ToolStep { name: string; args: string; result?: string; callId?// An assistant turn is an ORDERED list of blocks appended as events arrive, so tool activity is// interleaved with prose in real time (not all tools hoisted to the top).export type Block = { kind: 'text'; text: string } | { kind: 'tools'; reasoning: string; steps: ToolStep[] };++// The failure sentence reaches a message on two paths, the turn's own stream and the settled+// read of the turns feed, and the second arrival must not print it twice: a message that already+// ends with this exact error keeps it once (seen as "Error: X Error: X" under a refused turn).+function withError(blocks: Block[], msg: string): Block[] {+ const last = blocks[blocks.length - 1];+ if (last && last.kind === 'text' && last.text.trimEnd().endsWith('Error: ' + msg)) return blocks;+ return withText(blocks, '\n\nError: ' + msg);+}export interface AsstMsg { role: 'assistant'; blocks: Block[]; files: RespFile[]; status: 'running' | 'done' | 'failed' | 'cancelled' | 'incomplete';/** Why an incomplete turn is incomplete (max_steps | timeout | interrupted) — from the* gateway's incomplete_details. Absent on records from before the field existed, which is@@ -223,7 +232,7 @@ function applyBusEvent(sid: string, responseId: string, ev: Record<string, unknosetConvState(sid, { busy: false, prevId: responseId, firstTurn: false }); break;}case 'error':- busUpdateLast(sid, (a) => { a.blocks = withText(a.blocks, '\n\nError: ' + ((ev.message as string) || 'stream error')); }); break;+ busUpdateLast(sid, (a) => { a.blocks = withError(a.blocks, (ev.message as string) || 'stream error'); }); break;}}export function useHarnessBus(harnessId: string, onActivity?: () => void) {@@ -481,7 +490,7 @@ export function useConversationTurn({ harnessId, sessionId, target, onRan, onSesonToolResult: (callId, output) => updateLast((a) => { a.blocks = withResult(a.blocks, callId, output); }),onTextDelta: (d) => updateLast((a) => { a.blocks = withText(a.blocks, d); }),onFile: (f) => updateLast((a) => { a.files = [...a.files, f]; }),- onError: (msg) => updateLast((a) => { a.blocks = withText(a.blocks, '\n\nError: ' + msg); }),+ onError: (msg) => updateLast((a) => { a.blocks = withError(a.blocks, msg); }),onDone: (status) => {updateLast((a) => {a.status = status === 'completed' ? 'done'@@ -527,7 +536,7 @@ export function useConversationTurn({ harnessId, sessionId, target, onRan, onSes.catch(() => { /* keep the dialog, just without a figure */ });}if (pendId) dropPending(pendId);- updateLast((a) => { a.blocks = withText(a.blocks, '\n\nError: ' + (e instanceof Error ? e.message : String(e))); a.status = 'failed'; });+ updateLast((a) => { a.blocks = withError(a.blocks, e instanceof Error ? e.message : String(e)); a.status = 'failed'; });}} finally {sendingRef.current = false;diff --git a/ui/src/lib/harness.ts b/ui/src/lib/harness.tsindex d5dbedc7..43c4980b 100644--- a/ui/src/lib/harness.ts+++ b/ui/src/lib/harness.ts@@ -84,7 +84,7 @@ export const OOB: OobHarness[] = [tools: [], skills: [] },{ id: 'qwen', name: 'Qwen Code', version: 'v0.22.1', backend: 'qwen', status: 'ready',// Same relay reach as pi/opencode; qwen family first since it is the backend's home family.- models: ['qwen3.7-max', 'qwen3.8-max', 'gpt-5.4', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-5.5', 'gpt-5.4-mini', 'gpt-5.2', 'gpt-5.3-codex', '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'], defaultModel: 'qwen3.7-max', moreModels: 0,+ models: ['qwen3.7-max', 'qwen3.8-max', 'gpt-5.4', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-5.5', 'gpt-5.4-mini', 'gpt-5.2', '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'], defaultModel: 'qwen3.7-max', moreModels: 0,systemPrompt: 'You are Qwen Code, 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: 'cline', name: 'Cline', version: 'v3.0.60', backend: 'cline', status: 'ready',