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: a published package's declared plugs are attached, as on every other install route (#565)
Rudy Mizrahi Celekli09cd0bffa9b3
diff --git a/gateway/app.py b/gateway/app.pyindex ae40b7e0..45629784 100644--- a/gateway/app.py+++ b/gateway/app.py@@ -21054,6 +21054,8 @@ async def publish_harness_plugin(hid: str, body: PluginPublishBody, request: Reqhb = HarnessBody(name=str(v.get("name") or ""), base=str(v.get("base") or ""), plugins=[item] + kept)hb.plugins = await _plugins_prepare(hb, org, previous=previous)await _vg_upsert("Harness", hid, {"plugins": json.dumps(hb.plugins), "updated_at": str(int(time.time() * 1000))})+ # AFTER the write, as in update_harness_public: this route installs a package too.+ await _plugs_ensure_required(org, hid)out = _harness_out(await _vertex_get(hid) or {"id": hid})return {"id": hid, "published": name, "plugins": out["plugins"]}diff --git a/gateway/tests/test_plugs.py b/gateway/tests/test_plugs.pyindex 7b417b76..df49efe7 100644--- a/gateway/tests/test_plugs.py+++ b/gateway/tests/test_plugs.py@@ -398,6 +398,24 @@ def test_a_package_that_requires_plugs_gets_them_on_install(client, world, monkeassert r.status_code == 422 and "requires" in r.text+def test_publishing_a_package_that_requires_plugs_attaches_them(client, world):+ """PUT …/plugin installs a package, so it binds what the package requires, as every other+ install route does. A package that requires nothing still attaches nothing."""+ hid = _harness(client)+ r = client.put(f"/v1/harnesses/{hid}/plugin", headers=HEADERS, json=_package({"plugs": ["github"]}))+ assert r.status_code == 200, r.text+ assert r.json()["published"] == "needs-plugs"+ assert [e["id"] for e in _get(client, f"/v1/harnesses/{hid}").json()["mcpServers"]] == ["mcp.plugs"]+ assert _get(client, f"/v1/harnesses/{hid}/servers/mcp.plugs").json()["plugs"] == ["github"]+ # a package that declares no plugs leaves the harness with no plugs server at all+ hid2 = _harness(client)+ r = client.put(f"/v1/harnesses/{hid2}/plugin", headers=HEADERS, json=_package({}))+ assert r.status_code == 200, r.text+ assert _get(client, f"/v1/harnesses/{hid2}").json()["mcpServers"] == []+ r = _get(client, f"/v1/harnesses/{hid2}/servers/mcp.plugs")+ assert r.status_code == 404 and r.json()["error"]["code"] == "server_not_connected", r.text++# ── the tool surface itself ──────────────────────────────────────────────────────────────────def test_the_tool_table_is_well_formed():for plug in plugs_plane.TYPES: