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(backends): DeepSeek Harness, the fifth — official SDK transport, with a relay that unbreaks aggregator tool calls
richard-epsilla28bb06a9a6e1
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex df908d65..fec6fefc 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -163,7 +163,7 @@ jobs:docker logs smoke 2>&1 | tail -30LINE=$(docker logs smoke 2>&1 | grep "backends available" | tail -1 || true)echo "$LINE"- for b in claude codex hermes pi; do+ for b in claude codex hermes pi dsh; doecho "$LINE" | grep -q "$b" || { echo "::error::$b did not install on ${{ matrix.arch }}"; exit 1; }donedocker exec smoke ls /opt/harnessrouter/kitsdiff --git a/README.md b/README.mdindex 59d80b29..c80a0e9b 100644--- a/README.md+++ b/README.md@@ -138,8 +138,9 @@ Wait for `ready on :3000`, then open the browser:[harnessrouter] installing Claude Code (Anthropic's terms apply)…[harnessrouter] installing Codex (Apache-2.0)…[harnessrouter] installing Pi (MIT) and its MCP adapter (MIT)…+[harnessrouter] installing DeepSeek Harness (MIT, developer preview — version-pinned)…[harnessrouter] installing Hermes (check its upstream license before use)…-[harnessrouter] data=/data backends available: claude codex hermes pi+[harnessrouter] data=/data backends available: claude codex hermes pi dsh[harnessrouter] ready on :3000```@@ -164,8 +165,9 @@ licensing fact rather than a packaging preference. Claude Code is distributed unterms and hermes-agent declares no license at all, so neither can be redistributed inside a publicimage. Installing them on first run means you install them yourself, from upstream, under thoseterms — which is also why you should read them before you use those two backends. Codex-(Apache-2.0) and Pi (MIT, with its MIT-licensed MCP adapter) arrive the same way, so all-four land in one place.+(Apache-2.0), Pi (MIT, with its MIT-licensed MCP adapter) and DeepSeek Harness (MIT,+a developer preview pinned to an exact version) arrive the same way, so all five land+in one place.</details>@@ -260,12 +262,12 @@ problem, because it only offers you providers that work.|---|---|| `anthropic` | Claude Code, Hermes, Pi || `openai` | Codex, Hermes, Pi |-| `openrouter` | Codex, Hermes, Pi |+| `openrouter` | Codex, Hermes, Pi, DeepSeek Harness || `azure-foundry` | Codex, Hermes, Pi || `bedrock` | Claude Code, Hermes |-| `tokenrouter` | Claude Code, Codex, Hermes, Pi |-| `vercel` | Claude Code, Codex, Hermes, Pi |-| `llmtr` | Claude Code, Codex, Hermes, Pi |+| `tokenrouter` | Claude Code, Codex, Hermes, Pi, DeepSeek Harness |+| `vercel` | Claude Code, Codex, Hermes, Pi, DeepSeek Harness |+| `llmtr` | Claude Code, Codex, Hermes, Pi, DeepSeek Harness |</details>diff --git a/docker/entrypoint.sh b/docker/entrypoint.shindex 3ea002c7..e2b0bd95 100644--- a/docker/entrypoint.sh+++ b/docker/entrypoint.sh@@ -124,7 +124,7 @@ export HOSTNAME=0.0.0.0TOOLS="$DATA_DIR/agent-tools"export PATH="$TOOLS/bin:$PATH"export NODE_PATH="$TOOLS/lib/node_modules"-export HR_BACKENDS="${HR_BACKENDS:-claude,codex,hermes,pi}"+export HR_BACKENDS="${HR_BACKENDS:-claude,codex,hermes,pi,dsh}"wanted() { [[ ",$HR_BACKENDS," == *",$1,"* ]]; }# The executable IS the definition of "installed" — an installer that exits 0 without producing@@ -136,6 +136,7 @@ backend_bin() {codex) echo "$TOOLS/bin/codex" ;;hermes) echo "$TOOLS/venv/bin/hermes" ;;pi) echo "$TOOLS/bin/pi" ;;+ dsh) echo "$TOOLS/dsh-venv/bin/dsh-ready" ;;esac}@@ -180,6 +181,22 @@ install_backends() {@earendil-works/pi-coding-agent pi-mcp-adapter || truefi+ if wanted dsh && [ ! -x "$(backend_bin dsh)" ]; then+ echo "[harnessrouter] installing DeepSeek Harness (MIT, developer preview — version-pinned)…"+ # Pinned EXACTLY, not 'latest': upstream is a developer preview that warns of breaking+ # changes, and the runner's driver/normalizer are written against these bytes. An upgrade+ # is an adapter-compatibility change that lands through a PR, never through a fresh volume+ # pulling a newer wheel. Own venv: its dependency tree must not fight hermes's.+ try_install "DeepSeek Harness" sh -c "\"$PY\" -m venv \"$TOOLS/dsh-venv\" \+ && \"$TOOLS/dsh-venv/bin/pip\" install --no-cache-dir -q \+ 'deepseek-harness-sdk==0.1.0rc7' 'deepseek-harness-runtime-bin==0.1.0rc7' pyyaml \+ && \"$TOOLS/dsh-venv/bin/python\" -c 'import deepseek_harness, deepseek_harness_runtime, yaml; deepseek_harness_runtime.bundled_runtime_path()' \+ && printf '#!/bin/sh\nexit 0\n' > \"$TOOLS/dsh-venv/bin/dsh-ready\" \+ && chmod +x \"$TOOLS/dsh-venv/bin/dsh-ready\"" || true+ # dsh-ready exists ONLY after the import check proved the runtime executable resolves —+ # a venv whose pip half-failed must not report the backend as available.+ fi+if wanted hermes && [ ! -x "$(backend_bin hermes)" ]; thenecho "[harnessrouter] installing Hermes (check its upstream license before use)…"try_install "Hermes" sh -c "\"$PY\" -m venv \"$TOOLS/venv\" \@@ -197,6 +214,7 @@ install_backends() {# all unusable, which is exactly the choice the licence note above asks people to make.# Where the runner finds the MCP extension to mount (-e) on pi turns with MCP servers.[ -d "$TOOLS/lib/node_modules/pi-mcp-adapter" ] && export HR_PI_MCP_EXT="$TOOLS/lib/node_modules/pi-mcp-adapter"+ [ -x "$TOOLS/dsh-venv/bin/python" ] && export HR_DSH_PYTHON="$TOOLS/dsh-venv/bin/python"if wanted hermes; then verify_hermes_mcp; fi}@@ -236,7 +254,7 @@ cleanup() { trap - TERM INT; for p in "${pids[@]:-}"; do kill "$p" 2>/dev/null |trap cleanup TERM INT EXITavail=""; missing=""-for b in claude codex hermes pi; do+for b in claude codex hermes pi dsh; dowanted "$b" || continueif [ -x "$(backend_bin "$b")" ]; then avail="$avail $b"; else missing="$missing $b"; fidonediff --git a/gateway/app.py b/gateway/app.pyindex db356fc1..dfd32699 100644--- a/gateway/app.py+++ b/gateway/app.py@@ -930,6 +930,12 @@ _INTEGRATION_WIRING: dict[tuple[str, str], str] = {("openrouter", "pi"): "openai-api",("tokenrouter", "pi"): "tokenrouter", ("vercel", "pi"): "tokenrouter",("llmtr", "pi"): "tokenrouter",+ # dsh (DeepSeek Harness) runs the deepseek family over any OpenAI-compatible endpoint —+ # 'deepseek' on the runner means exactly that (base_url + key; the driver's relay+ # normalizes aggregator stream quirks). A first-party DeepSeek Platform integration is+ # NOT listed yet: nobody here holds a platform.deepseek.com key, and unprobed is unlisted.+ ("tokenrouter", "dsh"): "deepseek", ("openrouter", "dsh"): "deepseek",+ ("vercel", "dsh"): "deepseek", ("llmtr", "dsh"): "deepseek",}@@ -4403,6 +4409,13 @@ _MODEL_CATALOG: dict[str, dict] = {# nemotron-3-ultra and qwen3.7-flash are NOT here: TokenRouter lists no channel for them,# hermes serves them via OpenRouter, and no OpenRouter credential was available to probe# pi with — unprobed is unlisted, per the bar at the top of this table.+ # dsh (DeepSeek Harness) is single-family BY DESIGN in this first phase: the audit that+ # scoped this backend (2026-08-13, harnessrouter-management) defers multi-provider+ # composition until one provider path has proven model/usage/tool/error consistency.+ # Both models probe-verified through the full product path on the TokenRouter connection+ # (2026-08-20), substitution-checked.+ "dsh": {"default": "deepseek-v4-pro",+ "models": ["deepseek-v4-pro", "deepseek-v4-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",@@ -4412,7 +4425,7 @@ _MODEL_CATALOG: dict[str, dict] = {"kimi-k2.7-code", "qwen3.7-max", "qwen3.8-max","mistral-medium-3.5", "step-3.7-flash"]},}-_BARE_MODELS = {"", "claude", "codex", "anthropic", "bedrock", "openai", "hermes", "pi"}+_BARE_MODELS = {"", "claude", "codex", "anthropic", "bedrock", "openai", "hermes", "pi", "dsh", "deepseek"}# Models whose serving CHANNEL refuses image input outright. Measured, not assumed — probed# 2026-08-19 on the TokenRouter connection with a data-URI image in a user message:# qwen3.7-max -> 400 InvalidParameter "Unexpected item type in content" (rejects the TYPE)@@ -4459,6 +4472,8 @@ def _backend_of_harness(hv: dict | None) -> str:return "hermes"if base == "pi":return "pi"+ if base in ("dsh", "deepseek-harness"):+ return "dsh"return ""@@ -4472,6 +4487,8 @@ def _model_authorized(requested: str, backend: str) -> bool:return True # power users may pass a provider-native claude id (claude-opus-4-8 / us.anthropic...)if backend in ("codex", "hermes", "pi") and r.startswith("gpt-"):return True # gpt-* family; Azure deployment names vary+ if backend == "dsh" and r.startswith(("deepseek", "deepseek/")):+ return True # deepseek family; aggregator slugs vary (deepseek/deepseek-v4-pro)return False@@ -5355,7 +5372,7 @@ async def create_response(body: CreateResponseBody, request: Request):# explicitly selected — that's not a valid provider id. Treat it as "unset" and inherit, in order:# previous round's model -> the harness default_model -> connection default (in _map_model).# This keeps a conversation on the user's chosen model and never ships the bare backend to Bedrock.- _BARE = {"claude", "codex", "anthropic", "bedrock", "openai", "hermes", "pi", ""}+ _BARE = {"claude", "codex", "anthropic", "bedrock", "openai", "hermes", "pi", "dsh", "deepseek", ""}if model_req.lower() in _BARE:inherited = ""if body.previous_response_id:@@ -10875,6 +10892,17 @@ _BASE_CATALOG: dict[str, dict] = {("edit", "Edit")],"tool_enforcement": "hard",},+ "dsh": {+ "label": "DeepSeek Harness", "backend": "dsh", "status": "ready",+ "system_prompt": ("You are DeepSeek Harness, an autonomous coding agent. You work on a "+ "real git workspace, running shell commands and editing files to "+ "complete the task end to end."),+ # The bundled runtime's model-facing tools. No per-tool switch exists on the wire, so+ # disabling is an instruction to the model, the same standing as codex/hermes.+ "tools": [("bash", "Bash"), ("read", "File Read"), ("write", "File Write"),+ ("edit", "Edit"), ("todo_write", "Todo"), ("subagent", "Subagent")],+ "tool_enforcement": "instruction",+ },}# Bases this server can execute. Derived from the catalog above so the two cannot disagree —diff --git a/runner/dsh_driver.py b/runner/dsh_driver.pynew file mode 100644index 00000000..130e8c10--- /dev/null+++ b/runner/dsh_driver.py@@ -0,0 +1,175 @@+"""One DeepSeek Harness turn, as a runner subprocess.++Spawned per turn by server.py (the same one-process-per-turn contract as every other backend:+the runner reads NDJSON off stdout, cancel is a process-group kill). Inside, the official+Python SDK (`deepseek-harness-sdk`, pinned) drives the bundled JSON-RPC runtime executable+(`deepseek-harness-runtime-bin`, same pinned version); every `session.event` notification is+re-emitted on stdout as one JSON line for server.py's normalizer.++THE RELAY, and why it exists. The dsh LLM adapter accumulates streamed tool calls the OpenAI+way — id from `call.id`, name from `call.function.name`, guarded by `!== undefined`. OpenAI+OMITS those fields on continuation deltas; aggregators like TokenRouter send them as EMPTY+STRINGS, so the second delta overwrites the real id/name with "" and every tool call dies as+UNKNOWN_TOOL (captured live 2026-08-20 against deepseek/deepseek-v4-flash). The relay sits on+loopback between the runtime and the endpoint and drops those empty fields from tool_call+deltas — nothing else is touched. It also means the REAL key lives only in this process: the+runtime is launched with DEEPSEEK_BASE_URL pointing at the relay and a placeholder key, so the+credential never enters the dsh process env, its session log, or anything it could checkpoint.+"""+from __future__ import annotations++import http.server+import json+import os+import pathlib+import socket+import sys+import threading+import urllib.request++UPSTREAM_BASE = "" # set in main() from HR_DSH_BASE_URL, then scrubbed from the env+UPSTREAM_KEY = ""+++def _rewrite_sse_line(line: bytes) -> bytes:+ """Drop empty-string id/name from tool_call deltas in one `data:` SSE line."""+ if not line.startswith(b"data: {"):+ return line+ try:+ obj = json.loads(line[6:])+ for ch in obj.get("choices") or []:+ for tc in (ch.get("delta") or {}).get("tool_calls") or []:+ if tc.get("id") == "":+ del tc["id"]+ fn = tc.get("function") or {}+ if fn.get("name") == "":+ del fn["name"]+ return b"data: " + json.dumps(obj, separators=(",", ":")).encode()+ except Exception: # noqa: BLE001 — a line we cannot parse is a line we must not alter+ return line+++class _Relay(http.server.BaseHTTPRequestHandler):+ protocol_version = "HTTP/1.1"++ def do_POST(self): # noqa: N802+ body = self.rfile.read(int(self.headers.get("content-length") or 0))+ # DEEPSEEK_BASE_URL carries /v1 and the adapter appends /chat/completions, so the+ # incoming path is /v1/...; the upstream base also ends in /v1 — join without doubling.+ tail = self.path.removeprefix("/v1") if self.path.startswith("/v1/") else self.path+ req = urllib.request.Request(+ UPSTREAM_BASE.rstrip("/") + tail,+ data=body, method="POST",+ headers={"content-type": self.headers.get("content-type") or "application/json",+ "authorization": f"Bearer {UPSTREAM_KEY}",+ "accept": self.headers.get("accept") or "*/*"})+ try:+ resp = urllib.request.urlopen(req, timeout=600)+ except urllib.error.HTTPError as e: # pass provider errors through verbatim+ data = e.read()+ self.send_response(e.code)+ self.send_header("content-type", e.headers.get("content-type") or "application/json")+ self.send_header("content-length", str(len(data)))+ self.end_headers()+ self.wfile.write(data)+ return+ ctype = resp.headers.get("content-type") or ""+ self.send_response(resp.status)+ self.send_header("content-type", ctype)+ if "text/event-stream" in ctype:+ self.send_header("transfer-encoding", "chunked")+ self.end_headers()+ buf = b""+ while True:+ chunk = resp.read(4096)+ if not chunk:+ break+ buf += chunk+ while b"\n" in buf:+ line, buf = buf.split(b"\n", 1)+ out = _rewrite_sse_line(line.rstrip(b"\r")) + b"\n"+ self.wfile.write(f"{len(out):x}\r\n".encode() + out + b"\r\n")+ self.wfile.flush()+ if buf:+ out = _rewrite_sse_line(buf)+ self.wfile.write(f"{len(out):x}\r\n".encode() + out + b"\r\n")+ self.wfile.write(b"0\r\n\r\n")+ else:+ data = resp.read()+ self.send_header("content-length", str(len(data)))+ self.end_headers()+ self.wfile.write(data)++ def log_message(self, *a): # diagnostics belong on stderr, never stdout+ pass+++def _emit(method: str, payload) -> None:+ sys.stdout.write(json.dumps({"m": method, "p": payload}, default=str) + "\n")+ sys.stdout.flush()+++def _mcp_cordis(home: pathlib.Path, servers: list[dict]) -> str | None:+ """Bundled default composition + one dsh-mcp-client entry per enabled server."""+ import deepseek_harness_runtime as runtime+ base = pathlib.Path(runtime.bundled_default_config_path()).read_text()+ blocks = []+ for i, s in enumerate(servers):+ url = (s or {}).get("url")+ if not url:+ continue+ name = "".join(c for c in str((s or {}).get("name") or f"mcp{i}") if c.isalnum() or c in "_-")[:32] or f"mcp{i}"+ entry = {"id": f"hr-mcp-{i}", "name": "@deepseek-ai/dsh-mcp-client",+ "config": {"transport": "streamable-http", "serverName": name, "url": url}}+ hdrs: dict = {}+ auth = (s or {}).get("auth")+ if auth:+ hdrs["Authorization"] = auth if str(auth).lower().startswith("bearer ") else f"Bearer {auth}"+ if isinstance((s or {}).get("headers"), dict):+ hdrs.update({str(k): str(v) for k, v in s["headers"].items() if k and v is not None})+ if hdrs:+ entry["config"]["headers"] = hdrs+ blocks.append(entry)+ if not blocks:+ return None+ import yaml+ path = home / ".dsh" / "cordis.yml"+ path.parent.mkdir(parents=True, exist_ok=True)+ path.write_text(base + "\n" + yaml.safe_dump(blocks, sort_keys=False))+ return str(path)+++def main() -> int:+ global UPSTREAM_BASE, UPSTREAM_KEY+ job = json.loads(sys.argv[1])+ UPSTREAM_BASE = os.environ.pop("HR_DSH_BASE_URL", "")+ UPSTREAM_KEY = os.environ.pop("HR_DSH_API_KEY", "")+ home = pathlib.Path(os.environ.get("HOME") or ".")+ cwd = job.get("cwd") or os.getcwd()+ sessions = home / ".dsh" / "sessions"+ sessions.mkdir(parents=True, exist_ok=True)++ srv = http.server.ThreadingHTTPServer(("127.0.0.1", 0), _Relay)+ threading.Thread(target=srv.serve_forever, daemon=True).start()+ os.environ["DEEPSEEK_BASE_URL"] = f"http://127.0.0.1:{srv.server_address[1]}/v1"+ os.environ["DEEPSEEK_API_KEY"] = "hr-relay" # the real key never reaches the runtime++ from deepseek_harness import DeepSeekHarness++ kwargs = dict(provider="deepseek-official", model=job["model"],+ cwd=cwd, session_root=str(sessions))+ cordis = _mcp_cordis(home, job.get("mcp_servers") or [])+ if cordis:+ kwargs["cordis"] = cordis+ sid = job.get("session_id") or None+ _emit("__hr_init", {"session_id": sid or "", "relay_port": srv.server_address[1]})+ with DeepSeekHarness(**kwargs) as h:+ r = h.run(job["prompt"], session_id=sid,+ on_notification=lambda n: _emit(getattr(n, "method", ""), getattr(n, "payload", None)))+ _emit("__hr_result", {"final": r.final_response or "", "reason": r.finish_reason,+ "session_id": r.session_id})+ return 0+++if __name__ == "__main__":+ sys.exit(main())diff --git a/runner/server.py b/runner/server.pyindex e90ea83d..0edc6cd0 100644--- a/runner/server.py+++ b/runner/server.py@@ -24,6 +24,10 @@ Backends + providers (registry-driven — pi was added as exactly that one entry- azure-foundry : AZURE_FOUNDRY_API_KEY + AZURE_FOUNDRY_BASE_URL (gpt family)- bedrock : AWS_BEARER_TOKEN_BEDROCK (or key pair) + AWS_REGION (claude family)- anthropic : ANTHROPIC_API_KEY (+ optional ANTHROPIC_BASE_URL)+ backend "dsh" (DeepSeek Harness; official Python SDK drives the bundled JSON-RPC+ runtime — runner/dsh_driver.py re-emits its session.events as NDJSON):+ - deepseek : any OpenAI-compatible deepseek-family endpoint; DEEPSEEK-shaped auth+ goes to the driver as HR_DSH_* and stays OUT of the runtime envbackend "pi" (earendil-works pi coding agent; `pi -p --mode json` event stream,multi-family like hermes — custom providers via ~/.pi/agent/models.json):- anthropic : ANTHROPIC_API_KEY (native), base_url via models.json when set@@ -164,6 +168,10 @@ CHECKPOINT_EXCLUDE = ["./tmp", "./.gcp-sa.json", "./.codex", "./.credentials.jso# key for custom providers — neither may travel in a checkpoint tarball."./.harness/home/.pi/agent/auth.json","./.harness/home/.pi/agent/models.json",+ # dsh: the MCP cordis overlay can carry auth headers (same standing as+ # claude's .mcp.json); the provider KEY itself never lands anywhere —+ # it lives only in the driver process (see dsh_driver.py's relay).+ "./.harness/home/.dsh/cordis.yml",# Dependency/scratch dirs (any depth): re-creatable by the agent, and they# dominate checkpoint size — a node project checkpointed 200MB+ and paid# that again on every hydrate. The agent reinstalls when it needs them.@@ -177,6 +185,7 @@ CODEX_DEFAULT_MODEL = os.environ.get("CODEX_DEFAULT_MODEL", "gpt-5.4")HERMES_DEFAULT_MODEL = os.environ.get("HERMES_DEFAULT_MODEL", "gpt-5.4")# Pi default — pi is multi-family the same way hermes is; same reasoning, same default.PI_DEFAULT_MODEL = os.environ.get("PI_DEFAULT_MODEL", "gpt-5.4")+DSH_DEFAULT_MODEL = os.environ.get("DSH_DEFAULT_MODEL", "deepseek-v4-pro")CODEX_REASONING_EFFORT = os.environ.get("CODEX_REASONING_EFFORT", "medium")CODEX_CONTEXT_WINDOW = os.environ.get("CODEX_CONTEXT_WINDOW", "400000")# Provider defaults (overridable per-turn via auth.base_url). Wired from pool env.@@ -464,10 +473,10 @@ _AGENTS_END = "<!-- harness-skills:end -->"def _agent_doc_path(cwd: str, backend: str) -> pathlib.Path:- """The agent's instruction file: AGENTS.md for Codex, Hermes and Pi (all three read AGENTS.md- from the cwd — pi loads it as a context file, before its project-trust gate), CLAUDE.md for- Claude Code — each CLI reads its own file as project instructions."""- return pathlib.Path(cwd) / ("AGENTS.md" if backend in ("codex", "hermes", "pi") else "CLAUDE.md")+ """The agent's instruction file: AGENTS.md for Codex, Hermes, Pi and dsh (all four read+ AGENTS.md from the cwd — pi as a context file before its trust gate, dsh via its+ dsh-agent-instructions workspace loader), CLAUDE.md for Claude Code."""+ return pathlib.Path(cwd) / ("AGENTS.md" if backend in ("codex", "hermes", "pi", "dsh") else "CLAUDE.md")def _write_agent_doc(cwd: str, backend: str, agent_doc: str | None, skills_meta: list[dict]) -> None:@@ -1080,6 +1089,148 @@ def _build_codex(provider: str, auth: Auth, model: str, prompt: str, cwd: str,return ["codex", "exec", *common, "--cd", cwd, prompt]+# ── dsh (DeepSeek Harness) ──────────────────────────────────────────────────────+# The turn process is runner/dsh_driver.py inside the pinned dsh venv: the official Python SDK+# launches the bundled runtime executable, and every session.event notification comes back as+# one NDJSON line {"m": method, "p": payload}. Cancel stays a process-group kill — the SDK's+# close ladder never runs on a killed driver, and the runtime dies with the group.+DSH_PROVIDERS = {"deepseek"}+DSH_PYTHON = os.environ.get("HR_DSH_PYTHON", "/data/agent-tools/dsh-venv/bin/python")+DSH_DRIVER = os.path.join(os.path.dirname(os.path.abspath(__file__)), "dsh_driver.py")+++def _build_dsh(provider: str, auth: Auth, model: str, prompt: str, cwd: str, env: dict,+ resume_session_id: str | None = None,+ mcp_servers: list[dict] | None = None) -> list[str]:+ pr = provider or "deepseek"+ if pr not in DSH_PROVIDERS:+ raise HTTPException(400, f"unknown dsh provider '{pr}' (one of {sorted(DSH_PROVIDERS)})")+ if not auth.base_url and not auth.api_key:+ raise HTTPException(400, "dsh needs an OpenAI-compatible endpoint (base_url) and api_key")+ # HR_DSH_*: consumed and scrubbed by the driver before the runtime starts. The runtime gets+ # a loopback relay URL and a placeholder key — the credential never enters its environment.+ env["HR_DSH_BASE_URL"] = (auth.base_url or "https://api.deepseek.com/v1")+ env["HR_DSH_API_KEY"] = auth.api_key or ""+ # No system_prompt in the job: harness instructions land in AGENTS.md (dsh reads it via+ # its dsh-agent-instructions loader), same mechanism as codex/hermes/pi.+ job = {"prompt": prompt, "model": model, "cwd": cwd,+ "session_id": resume_session_id or "",+ "mcp_servers": [s for s in (mcp_servers or []) if (s or {}).get("url")]}+ return [DSH_PYTHON, DSH_DRIVER, json.dumps(job)]+++def _dsh_tool_result_text(msg: dict) -> tuple[str, str, bool]:+ """(tool_use_id, text, is_error) from a dsh tool/result data.message."""+ tuid, text, err = "", "", False+ for c in (msg.get("content") or []):+ if isinstance(c, dict) and c.get("type") == "tool-result":+ tuid = str(c.get("toolCallId") or "")+ err = bool(c.get("isError"))+ parts = [x.get("text") or "" for x in (c.get("content") or [])+ if isinstance(x, dict) and x.get("type") == "text"]+ text = "\n".join(x for x in parts if x)+ return tuid, text, err+++def _dsh_to_claude(obj: dict, state: dict) -> list[dict]:+ """Map ONE driver NDJSON line to zero+ canonical claude stream-json events.++ Shapes are the live captures of 2026-08-20 (bad-key run, tool run, retry run) — see the+ fixtures in tests/test_dsh_normalize.py. Two audit rules are load-bearing here: usage is+ keyed by (turn, step) and REPLACED, never summed twice; and the terminal status comes from+ the last turn/end reason — the driver exits 0 either way."""+ m, p = obj.get("m"), obj.get("p") or {}+ if m == "__hr_init":+ sid = p.get("session_id") or ""+ if sid:+ state["_dsh_init"] = True+ return [{"type": "system", "subtype": "init", "session_id": sid,+ "model": state.get("model")}]+ return []+ if m == "__hr_result":+ usage_map = state.get("_dsh_usage") or {}+ usage: dict = {}+ for u in usage_map.values():+ for k, v in u.items():+ usage[k] = usage.get(k, 0) + v+ usage = {k: v for k, v in usage.items() if v}+ reason = p.get("reason")+ final = p.get("final") or state.get("final", "")+ state["final"] = final+ if reason == "completed" or (reason is None and final):+ return [{"type": "result", "subtype": "success", "is_error": False,+ "result": final, "usage": usage}]+ if reason == "max-tokens":+ return [{"type": "result", "subtype": "error_max_turns", "is_error": False,+ "result": final, "usage": usage}]+ err = state.get("_dsh_error") or f"deepseek-harness turn ended: {reason}"+ return [{"type": "result", "subtype": "error", "is_error": True,+ "result": err, "usage": usage}]+ if m != "session.event":+ return []+ ev = p.get("event") or {}+ t = ev.get("type")+ d = ev.get("data") or {}+ if not state.get("_dsh_init") and p.get("sessionId"):+ state["_dsh_init"] = True+ return [{"type": "system", "subtype": "init", "session_id": p["sessionId"],+ "model": state.get("model")}] + _dsh_to_claude(obj, state)+ if t == "assistant/chunk":+ c = d.get("chunk") or {}+ ct = c.get("type")+ if ct == "text-delta" and c.get("text"):+ state["_dsh_text"] = state.get("_dsh_text", "") + c["text"]+ state["final"] = state["_dsh_text"]+ return [{"type": "assistant", "message": {"content": [{"type": "text", "text": c["text"]}]}}]+ if ct == "reasoning-delta" and c.get("text"):+ return [{"type": "assistant", "message": {"content": [{"type": "thinking", "thinking": c["text"]}]}}]+ if ct == "usage":+ u = c.get("usage") or {}+ mapped = {"input_tokens": int(u.get("inputTokens") or 0),+ "output_tokens": int(u.get("outputTokens") or 0)}+ if u.get("cacheReadTokens"):+ mapped["cache_read_tokens"] = int(u["cacheReadTokens"])+ if u.get("cacheWriteTokens"):+ mapped["cache_write_tokens"] = int(u["cacheWriteTokens"])+ # replace-by-(turn,step): retries re-report the same step; summing would double-bill+ state.setdefault("_dsh_usage", {})[(d.get("turn"), d.get("step"))] = mapped+ return []+ return [] # block-start/block-end/tool-call-delta/finish: committed events cover them+ if t == "assistant/message":+ msg = d.get("message") or {}+ full = "".join(c.get("text") or "" for c in (msg.get("content") or [])+ if isinstance(c, dict) and c.get("type") == "text")+ streamed = state.get("_dsh_text", "")+ state["_dsh_text"] = ""+ if full:+ state["final"] = full+ if full and full != streamed:+ if not streamed:+ return [{"type": "assistant", "message": {"content": [{"type": "text", "text": full}]}}]+ if full.startswith(streamed):+ return [{"type": "assistant", "message": {"content": [{"type": "text", "text": full[len(streamed):]}]}}]+ return [] # matches, or a non-prefix revision (already painted — the pi lesson)+ if t == "tool/call":+ try:+ args = json.loads(d.get("arguments") or "{}")+ except Exception: # noqa: BLE001+ args = {"raw": d.get("arguments")}+ return [{"type": "assistant", "message": {"content": [+ {"type": "tool_use", "id": d.get("callId") or f"dsh{ev.get('seq', 0)}",+ "name": d.get("name") or "tool", "input": args}]}}]+ if t == "tool/result":+ tuid, text, err = _dsh_tool_result_text(d.get("message") or {})+ return [{"type": "user", "message": {"content": [+ {"type": "tool_result", "tool_use_id": tuid or "dsh",+ "is_error": err, "content": text}]}}]+ if t == "turn/end":+ reason = (d.get("reason") or {})+ if reason.get("kind") == "error":+ state["_dsh_error"] = str((reason.get("error") or {}).get("message") or "dsh error")+ return []+ return []++# ── pi (earendil-works pi coding agent) ─────────────────────────────────────────# One-shot turns run `pi -p --mode json`: a JSONL event stream on stdout (session header,# message deltas, tool executions, agent_end). Sessions are JSONL trees under@@ -1454,6 +1605,8 @@ BACKENDS = {"normalize": None},"pi": {"providers": sorted(PI_PROVIDERS), "default_model": PI_DEFAULT_MODEL,"normalize": _pi_to_claude},+ "dsh": {"providers": sorted(DSH_PROVIDERS), "default_model": DSH_DEFAULT_MODEL,+ "normalize": _dsh_to_claude},}@@ -2222,7 +2375,7 @@ def capabilities(identifier: str = "") -> dict:class TurnReq(BaseModel):- backend: str = "claude" # claude | codex | hermes | pi+ backend: str = "claude" # claude | codex | hermes | pi | dshprovider: str | None = None # see BACKENDS[...].providersmodel: str | None = Noneprompt: str@@ -2291,7 +2444,7 @@ def turn(req: TurnReq, identifier: str = "") -> dict:# than a block. Written here once rather than as two divergent branches — hermes previously# had neither, and silently ignored every disabled tool.agent_doc = req.agent_doc or ""- if backend in ("codex", "hermes") and req.tools_disabled:+ if backend in ("codex", "hermes", "dsh") and req.tools_disabled:_off = ", ".join(t for t in req.tools_disabled if t)if _off:agent_doc = ((agent_doc + "\n\n") if agent_doc.strip() else "") + \@@ -2336,6 +2489,10 @@ def turn(req: TurnReq, identifier: str = "") -> dict:hermes_provider = (req.provider or "bedrock").lower()hermes_mcp = _hermes_prepare_env(hermes_provider, auth, cwd, env, model=model,max_turns=req.max_turns, mcp_servers=req.mcp_servers)+ elif backend == "dsh":+ model = model or DSH_DEFAULT_MODEL+ cmd = _build_dsh(req.provider, auth, model, req.prompt, cwd, env,+ resume_session_id=req.resume_session_id, mcp_servers=req.mcp_servers)elif backend == "pi":model = model or PI_DEFAULT_MODELcmd = _build_pi(req.provider, auth, model, req.prompt, cwd, env,diff --git a/runner/tests/test_dsh_normalize.py b/runner/tests/test_dsh_normalize.pynew file mode 100644index 00000000..e5fddd01--- /dev/null+++ b/runner/tests/test_dsh_normalize.py@@ -0,0 +1,167 @@+"""The dsh normalizer and driver pieces, against live-captured wire shapes.++Every fixture below is verbatim from `deepseek-harness-sdk==0.1.0rc7` runs on 2026-08-20:+the bad-key run (error terminal), the TokenRouter tool run (tool/call + tool/result ++usage + retry ladder), and the raw TokenRouter SSE whose empty-string id/name fields are+the reason the driver's relay exists.+"""+import json+import pathlib+import sys++sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))+from server import _build_dsh, _dsh_to_claude, Auth # noqa: E402+sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))+import dsh_driver # noqa: E402+++def _run(lines, model="deepseek-v4-pro"):+ state = {"model": model, "final": ""}+ out = [_dsh_to_claude(ln, state) for ln in lines]+ return out, state+++def _flat(chunks):+ return [e for evs in chunks for e in evs]+++def _ev(t, seq, data, sid="s1"):+ return {"m": "session.event", "p": {"sessionId": sid, "event": {"type": t, "seq": seq, "time": 0, "data": data}}}+++# ── error terminal: the CLI-exits-0 lesson, dsh edition ─────────────────────────────+ERROR_RUN = [+ {"m": "__hr_init", "p": {"session_id": "spike-001"}},+ {"m": "session.status", "p": {"sessionId": "spike-001", "status": "running"}},+ _ev("turn/start", 1, {"turn": 1}, "spike-001"),+ _ev("assistant/chunk", 8, {"turn": 1, "step": 1, "chunk": {"type": "finish", "reason": {"kind": "error", "failure": {+ "message": "Authentication Fails, Your api key: ****-key is invalid", "code": "AUTH", "status": 401}}}}, "spike-001"),+ _ev("turn/end", 10, {"turn": 1, "reason": {"kind": "error", "error": {+ "message": "Authentication Fails, Your api key: ****-key is invalid", "code": "AUTH", "status": 401}}}, "spike-001"),+ {"m": "session.status", "p": {"sessionId": "spike-001", "status": "idle"}},+ {"m": "__hr_result", "p": {"final": "", "reason": "error", "session_id": "spike-001"}},+]+++def test_error_run_yields_error_result():+ chunks, _ = _run(ERROR_RUN)+ results = [e for e in _flat(chunks) if e.get("type") == "result"]+ assert len(results) == 1+ assert results[0]["is_error"] is True+ assert "Authentication Fails" in results[0]["result"]+++def test_init_comes_from_hr_init():+ chunks, _ = _run(ERROR_RUN)+ init = _flat(chunks)[0]+ assert init["type"] == "system" and init["session_id"] == "spike-001"+++def test_init_falls_back_to_first_event_session_id():+ lines = [{"m": "__hr_init", "p": {"session_id": ""}},+ _ev("turn/start", 1, {"turn": 1}, "generated-sid"),+ {"m": "__hr_result", "p": {"final": "hi", "reason": "completed"}}]+ chunks, _ = _run(lines)+ init = next(e for e in _flat(chunks) if e.get("type") == "system")+ assert init["session_id"] == "generated-sid"+++# ── happy path with tools, streaming, usage dedup ───────────────────────────────────+HAPPY = [+ {"m": "__hr_init", "p": {"session_id": "t4"}},+ _ev("turn/start", 1, {"turn": 1}),+ _ev("assistant/chunk", 20, {"turn": 1, "step": 1, "chunk": {"type": "block-start", "index": 0, "blockType": "reasoning"}}),+ _ev("assistant/chunk", 21, {"turn": 1, "step": 1, "chunk": {"type": "reasoning-delta", "index": 0, "text": "The user wants echo."}}),+ _ev("assistant/chunk", 30, {"turn": 1, "step": 1, "chunk": {"type": "block-end", "index": 0, "block": {"type": "reasoning", "text": "The user wants echo."}}}),+ _ev("assistant/chunk", 32, {"turn": 1, "step": 1, "chunk": {"type": "usage", "usage": {"inputTokens": 210, "outputTokens": 87, "cacheReadTokens": 1024, "reasoningTokens": 17}}}),+ # a retry re-reports the same (turn, step): REPLACED, not summed+ _ev("assistant/chunk", 33, {"turn": 1, "step": 1, "chunk": {"type": "usage", "usage": {"inputTokens": 215, "outputTokens": 90, "cacheReadTokens": 1024}}}),+ _ev("tool/call", 35, {"turn": 1, "step": 1, "callId": "call_1", "name": "bash",+ "arguments": "{\"command\": \"echo hola-dsh\"}"}),+ _ev("tool/result", 36, {"turn": 1, "step": 1, "message": {"role": "user", "source": {"kind": "tool", "callId": "call_1"},+ "content": [{"type": "tool-result", "toolCallId": "call_1", "isError": False,+ "content": [{"type": "text", "text": "hola-dsh"}]}]}}),+ _ev("assistant/chunk", 40, {"turn": 1, "step": 2, "chunk": {"type": "text-delta", "index": 0, "text": "hola"}}),+ _ev("assistant/chunk", 41, {"turn": 1, "step": 2, "chunk": {"type": "text-delta", "index": 0, "text": "-dsh"}}),+ _ev("assistant/message", 42, {"turn": 1, "step": 2, "message": {"role": "assistant",+ "content": [{"type": "text", "text": "hola-dsh"}], "source": {"kind": "model"}}}),+ _ev("assistant/chunk", 43, {"turn": 1, "step": 2, "chunk": {"type": "usage", "usage": {"inputTokens": 300, "outputTokens": 5}}}),+ _ev("turn/end", 44, {"turn": 1, "reason": {"kind": "completed"}}),+ {"m": "__hr_result", "p": {"final": "hola-dsh", "reason": "completed", "session_id": "t4"}},+]+++def test_happy_path_thinking_text_and_result():+ chunks, state = _run(HAPPY)+ evs = _flat(chunks)+ thinking = [c["thinking"] for e in evs if e.get("type") == "assistant"+ for c in e["message"]["content"] if c.get("type") == "thinking"]+ assert thinking == ["The user wants echo."]+ texts = [c["text"] for e in evs if e.get("type") == "assistant"+ for c in e["message"]["content"] if c.get("type") == "text"]+ assert texts == ["hola", "-dsh"] # committed message matched the stream: no re-paint+ result = next(e for e in evs if e.get("type") == "result")+ assert result["subtype"] == "success" and result["result"] == "hola-dsh"+++def test_usage_replaced_per_step_then_summed():+ chunks, _ = _run(HAPPY)+ result = next(e for e in _flat(chunks) if e.get("type") == "result")+ # step1 replaced to 215/90 + step2 300/5; cacheRead from the replacement+ assert result["usage"] == {"input_tokens": 515, "output_tokens": 95, "cache_read_tokens": 1024}+++def test_tool_events_map():+ chunks, _ = _run(HAPPY)+ evs = _flat(chunks)+ use = next(c for e in evs if e.get("type") == "assistant"+ for c in e["message"]["content"] if c.get("type") == "tool_use")+ assert use["id"] == "call_1" and use["name"] == "bash" and use["input"] == {"command": "echo hola-dsh"}+ res = next(c for e in evs if e.get("type") == "user"+ for c in e["message"]["content"] if c.get("type") == "tool_result")+ assert res["tool_use_id"] == "call_1" and res["content"] == "hola-dsh" and res["is_error"] is False+++def test_max_tokens_maps_to_max_turns_subtype():+ lines = [{"m": "__hr_init", "p": {"session_id": "s"}},+ _ev("turn/end", 5, {"turn": 1, "reason": {"kind": "max-tokens"}}),+ {"m": "__hr_result", "p": {"final": "partial", "reason": "max-tokens"}}]+ chunks, _ = _run(lines)+ result = next(e for e in _flat(chunks) if e.get("type") == "result")+ assert result["subtype"] == "error_max_turns" and result["result"] == "partial"+++# ── the relay rewrite: the exact TokenRouter delta shapes ───────────────────────────+def test_relay_drops_empty_id_and_name_only():+ first = (b'data: {"choices":[{"delta":{"tool_calls":[{"index":0,"id":"call_617","type":"function",'+ b'"function":{"name":"bash","arguments":""}}]},"finish_reason":null,"index":0}]}')+ cont = (b'data: {"choices":[{"delta":{"tool_calls":[{"index":0,"id":"","type":"function",'+ b'"function":{"name":"","arguments":"{\\"command\\""}}]},"finish_reason":null,"index":0}]}')+ out1 = json.loads(dsh_driver._rewrite_sse_line(first)[6:])+ tc1 = out1["choices"][0]["delta"]["tool_calls"][0]+ assert tc1["id"] == "call_617" and tc1["function"]["name"] == "bash"+ out2 = json.loads(dsh_driver._rewrite_sse_line(cont)[6:])+ tc2 = out2["choices"][0]["delta"]["tool_calls"][0]+ assert "id" not in tc2 and "name" not in tc2["function"]+ assert tc2["function"]["arguments"] == '{"command"'+++def test_relay_leaves_non_data_lines_alone():+ assert dsh_driver._rewrite_sse_line(b"data: [DONE]") == b"data: [DONE]"+ assert dsh_driver._rewrite_sse_line(b"") == b""+++# ── builder ─────────────────────────────────────────────────────────────────────────+def test_build_dsh_stages_creds_out_of_argv(tmp_path):+ env = {"HOME": str(tmp_path)}+ cmd = _build_dsh("deepseek", Auth(api_key="k-secret", base_url="https://tr.example/v1"),+ "deepseek/deepseek-v4-pro", "do it", str(tmp_path), env,+ resume_session_id="sid-9",+ mcp_servers=[{"name": "wiki", "url": "https://mcp.example/mcp"}])+ assert env["HR_DSH_BASE_URL"] == "https://tr.example/v1"+ assert env["HR_DSH_API_KEY"] == "k-secret"+ assert "k-secret" not in " ".join(cmd) # the key travels in env, never argv (ps-visible)+ job = json.loads(cmd[2])+ assert job["session_id"] == "sid-9"+ assert job["mcp_servers"][0]["url"] == "https://mcp.example/mcp"+ assert "system_prompt" not in jobdiff --git a/ui/public/logos/deepseek.png b/ui/public/logos/deepseek.pngnew file mode 100644index 00000000..50e250d2Binary files /dev/null and b/ui/public/logos/deepseek.png differdiff --git a/ui/src/app/(app)/harnesses/[id]/page.tsx b/ui/src/app/(app)/harnesses/[id]/page.tsxindex 23a1f411..2ba1c9ee 100644--- a/ui/src/app/(app)/harnesses/[id]/page.tsx+++ b/ui/src/app/(app)/harnesses/[id]/page.tsx@@ -166,7 +166,7 @@ export default function HarnessSettingsPage() {<section className="form-section"><div><h3>Agent instructions</h3><p>Persistent role, conventions, constraints, and output contract loaded on every Task.</p></div><div className="field-stack">- <div className="field"><label htmlFor="hsInstructions">{['codex', 'hermes', 'pi'].includes(base?.id || draft?.base || '') ? 'AGENTS.md' : 'CLAUDE.md'}</label>+ <div className="field"><label htmlFor="hsInstructions">{['codex', 'hermes', 'pi', 'dsh'].includes(base?.id || draft?.base || '') ? 'AGENTS.md' : 'CLAUDE.md'}</label><textarea id="hsInstructions" rows={7} disabled={readOnly}value={oob ? oob.systemPrompt : (draft?.systemPrompt || '')}onChange={(e) => upd({ systemPrompt: e.target.value })} />diff --git a/ui/src/app/(app)/harnesses/page.tsx b/ui/src/app/(app)/harnesses/page.tsxindex 8c83e016..c70a662f 100644--- a/ui/src/app/(app)/harnesses/page.tsx+++ b/ui/src/app/(app)/harnesses/page.tsx@@ -54,6 +54,7 @@ export default function HarnessesPage() {// 'pi' must be an exact-ish match: substring would also catch every base that merely// contains the letters (nothing today, but 'claude' teaches the lesson cheaply).if (baseFlt === 'pi') return b === 'pi' || b.startsWith('pi ');+ if (baseFlt === 'dsh') return b === 'dsh' || b.includes('deepseek');return b.includes('claude');}).filter((r) => healthFlt === 'all' || (healthFlt === 'review') === isDegraded(r));@@ -87,6 +88,7 @@ export default function HarnessesPage() {<option value="codex">Codex</option><option value="claude">Claude Code</option><option value="pi">Pi</option>+ <option value="dsh">DeepSeek Harness</option><option value="hermes">Hermes</option></select><select className="select" aria-label="Filter Harnesses by health" value={healthFlt} onChange={(e) => setHealthFlt(e.target.value)}>@@ -158,7 +160,9 @@ export default function HarnessesPage() {? 'Self-improving agent that builds memory and skills across Tasks, best for evolving, long-running work.': o.id === 'pi'? 'Minimal, steerable harness with four core tools, best when you want a lean agent you can shape.'- : 'Best for long-context analysis, document workflows, and structured review.'}</span></span>+ : o.id === 'dsh'+ ? 'DeepSeek\u2019s own agent runtime, best for deep-reasoning work on the DeepSeek model family.'+ : 'Best for long-context analysis, document workflows, and structured review.'}</span></span><span className="base-choice-models">{oobDefaultModel(o)} default</span></label>))}diff --git a/ui/src/components/HarnessLogo.tsx b/ui/src/components/HarnessLogo.tsxindex 760a50bd..e3edb5cf 100644--- a/ui/src/components/HarnessLogo.tsx+++ b/ui/src/components/HarnessLogo.tsx@@ -1,6 +1,6 @@// Official brand marks for the default (OOB) harnesses, served from /public/logos.// claude-code -> claude.png (Anthropic), codex -> codex.png, pi -> pi.png,-// hermes -> hermes.png. Custom harnesses fall back to a generic glyph.+// hermes -> hermes.png, dsh -> deepseek.png. Custom harnesses fall back to a generic glyph.import React from 'react';const LOGO: Record<string, string> = {@@ -8,6 +8,7 @@ const LOGO: Record<string, string> = {codex: '/logos/codex.png',pi: '/logos/pi.png',hermes: '/logos/hermes.png',+ dsh: '/logos/deepseek.png',};export function HarnessLogo({ id, size = 26 }: { id: string; size?: number }) {diff --git a/ui/src/lib/harness.ts b/ui/src/lib/harness.tsindex 8d809f6f..b9e1eefd 100644--- a/ui/src/lib/harness.ts+++ b/ui/src/lib/harness.ts@@ -20,7 +20,7 @@ export interface OobHarness {defaultModel?: string; // the backend default, NOT necessarily models[0]moreModels?: number; // "+N" pillstatus: 'ready' | 'soon';- backend: 'claude' | 'codex' | 'hermes' | 'pi' | null; // gateway backend; null = coming soon+ backend: 'claude' | 'codex' | 'hermes' | 'pi' | 'dsh' | null; // gateway backend; null = coming soonsystemPrompt: string; // the harness's built-in system prompt (shown read-only)tools: string[]; // built-in tools (read-only)skills: string[]; // built-in skills (read-only)@@ -71,6 +71,11 @@ export const OOB: OobHarness[] = [models: ['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', 'kimi-k3', 'qwen3.7-max'], defaultModel: 'gpt-5.4', moreModels: 0,systemPrompt: 'You are Pi, a minimal autonomous coding agent. You operate on a real git workspace, reading, writing and editing files and running bash to complete the task end to end.',tools: [], skills: [] },+ { id: 'dsh', name: 'DeepSeek Harness', version: 'v0.1.0-rc.7', backend: 'dsh', status: 'ready',+ // Single-family by design in this phase (see gateway _MODEL_CATALOG).+ models: ['deepseek-v4-pro', 'deepseek-v4-flash'], defaultModel: 'deepseek-v4-pro', moreModels: 0,+ systemPrompt: 'You are DeepSeek Harness, an autonomous coding agent. You work on a real git workspace, running shell commands and editing files to complete the task end to end.',+ tools: [], skills: [] },];export const oobById = (id: string) => OOB.find((o) => o.id === id) || null;