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
plugs: InsForge's describe_table asks the route the vendor serves, and an agent is told its plug tools (#389)
github-actions[bot]473d7ac0c9a0
diff --git a/gateway/app.py b/gateway/app.pyindex 89e57125..f67cbecb 100644--- a/gateway/app.py+++ b/gateway/app.py@@ -13846,6 +13846,53 @@ _M365_GUIDE = ("identity. These tools read; they write nothing.")+def _plug_tool_names(plug: str) -> str:+ """Every tool of one plug as the agent sees it on the `plugs` server (<plug>_<tool>)."""+ return ", ".join(f"{plug}_{t['name']}" for t in plugs_plane._TOOLS.get(plug, []))+++# GitHub, Vercel and InsForge had no section, and an agent that is told nothing looks where these+# vendors usually live: a company's engineer (codex, gpt-5.4, 2026-10-04) searched the shell for+# VERCEL_TOKEN, VERCEL_ORG_ID and VERCEL_PROJECT_ID, ran `npx vercel ls`, found nothing and stopped+# with all three plugs connected. Codex keeps MCP tools behind its tool search, the Browser case+# exactly. So each section names the tools, says how the usual job is done with them, and says in+# words that the environment holds no token, which is the point: the credential never reaches a sandbox.+_PLUG_GUIDES: dict[str, str] = {+ "github": (+ "## GitHub\n"+ "This task works on the company's GitHub repository through the `plugs` server, with the "+ "company's own access. Its tools: {tools}. Read files, branch, commit, open, review and merge "+ "pull requests and run workflows with them; github_push_files commits several files to a "+ "branch at once. There is no GitHub token in the environment, and `git push` and the `gh` "+ "CLI are not signed in: a change reaches GitHub only through these tools. If they are not "+ "in your tool list, look them up (they may be deferred) before deciding the repository is "+ "out of reach."),+ "vercel": (+ "## Vercel\n"+ "This task deploys the company's Vercel project through the `plugs` server. Its tools: "+ "{tools}. To deploy: put the code in the linked GitHub repository, then call "+ "vercel_deploy_from_repo (name a ref for a preview; production true for production) and "+ "report the url it returns; vercel_get_deployment and vercel_get_deployment_logs say how a "+ "deployment went, vercel_set_env sets an environment variable. There is no VERCEL_TOKEN, "+ "project id or team id in the environment and the `vercel` CLI is not signed in: do not "+ "look for them, and do not report that deploying is impossible because they are missing. "+ "If these tools are not in your tool list, look them up (they may be deferred) first."),+ "insforge": (+ "## InsForge\n"+ "This task uses the company's InsForge backend (database, sign-in users, storage, "+ "functions) through the `plugs` server. Its tools: {tools}. insforge_get_project gives the "+ "backend's url and its public anon key for the app's own code; tables and rows are created, "+ "read and changed with the table tools, and insforge_request reaches the backend's other "+ "routes under /api/. Do not guess a route: GET /api/metadata describes the whole backend "+ "(its tables, auth settings, storage and functions); for sign-in users, POST /api/auth/users "+ "registers one, POST /api/auth/sessions signs one in (a backend may ask for a verified email "+ "first) and GET /api/auth/users lists them. A route that answers the backend's not-found "+ "page does not exist: do not try other spellings of it. There is no InsForge key in the "+ "environment. If these tools are not in your tool list, look them up (they may be deferred) "+ "first."),+}++def _agent_doc_with_plugs(agent_doc: str, plug_types: list[str]) -> str:"""The harness's instructions plus a section for each included plugin that needs one."""parts = [agent_doc.strip()] if agent_doc and agent_doc.strip() else []@@ -13853,6 +13900,9 @@ def _agent_doc_with_plugs(agent_doc: str, plug_types: list[str]) -> str:parts.append(_BROWSER_GUIDE)if "microsoft365" in plug_types:parts.append(_M365_GUIDE)+ for plug in ("github", "vercel", "insforge"):+ if plug in plug_types:+ parts.append(_PLUG_GUIDES[plug].format(tools=_plug_tool_names(plug)))return "\n\n".join(parts)diff --git a/gateway/plugs_plane.py b/gateway/plugs_plane.pyindex aedf63a7..102a3789 100644--- a/gateway/plugs_plane.py+++ b/gateway/plugs_plane.py@@ -1084,7 +1084,11 @@ async def _(c, f, cfg, a):@_tool("insforge", "describe_table", "read", "Columns of one table.", _obj({"table": _s("Table name")}, ("table",)))async def _(c, f, cfg, a):- return await _inf(c, f, cfg, "GET", f"/api/database/tables/{_need(a, 'table')}")+ # The vendor's route for a table's columns ends in /schema (InsForge's own router: GET+ # /:tableName/schema; the bare /:tableName is routed for DELETE alone). Without it the backend+ # answers its not-found page: every call of this tool by a real agent failed, eight of eight on+ # 2026-10-04, and the mock it was written against had no such path at all, so nothing said so.+ return await _inf(c, f, cfg, "GET", f"/api/database/tables/{_need(a, 'table')}/schema")@_tool("insforge", "query_rows", "read", "Read rows of a table with optional column selection, filters, order and limit.",diff --git a/gateway/tests/test_browser.py b/gateway/tests/test_browser.pyindex 31a07e08..3d421f0c 100644--- a/gateway/tests/test_browser.py+++ b/gateway/tests/test_browser.py@@ -888,7 +888,7 @@ def test_a_harness_with_the_browser_tells_its_agent_to_use_it():instructions, and nothing when it does not (Codex opened a page with curl while the cardstayed empty, hr-test 2026-09-27)."""assert gw._agent_doc_with_plugs("", []) == ""- assert gw._agent_doc_with_plugs("Be brief.", ["github"]) == "Be brief."+ assert gw._agent_doc_with_plugs("Be brief.", ["a-plug-with-no-section"]) == "Be brief." # github has its own since 2026-10-04doc = gw._agent_doc_with_plugs("Be brief.\n", ["browser"])assert doc.startswith("Be brief.\n\n## Browser\n") and "browser_navigate" in doc and "curl" in docassert gw._agent_doc_with_plugs("", ["browser"]) == gw._BROWSER_GUIDEdiff --git a/gateway/tests/test_plug_guides.py b/gateway/tests/test_plug_guides.pynew file mode 100644index 00000000..e9d4f5a6--- /dev/null+++ b/gateway/tests/test_plug_guides.py@@ -0,0 +1,34 @@+"""An agent is told which plug tools it has. GitHub, Vercel and InsForge had no section in the+agent's instructions, and an agent that is told nothing looks where these vendors usually live (a+token in the environment, a signed-in CLI) and reports the job impossible with the plug connected."""+from __future__ import annotations++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_an_agent_is_told_the_tools_of_each_connected_plug_and_that_no_token_is_in_the_environment():+ doc = gw._agent_doc_with_plugs("Be brief.", ["github", "vercel", "insforge"])+ assert doc.startswith("Be brief.")+ for name in ("github_push_files", "github_create_pull_request", "vercel_deploy_from_repo",+ "vercel_get_deployment_logs", "insforge_create_table", "insforge_get_project"):+ assert name in doc, name+ assert "no VERCEL_TOKEN" in doc and "`vercel` CLI is not signed in" in doc+ assert "## GitHub" in doc and "## Vercel" in doc and "## InsForge" in doc+ # the backend's real routes are named, so an agent does not walk its not-found page looking for them+ assert "GET /api/metadata" in doc and "POST /api/auth/sessions" in doc and "Do not guess a route" in doc+ assert "—" not in doc and "–" not in doc # no dash punctuation in copy an agent and a person read+ # every tool the plane has is named, so a new tool cannot be left out of the section+ for plug in ("github", "vercel", "insforge"):+ for t in gw.plugs_plane._TOOLS[plug]:+ assert f"{plug}_{t['name']}" in doc+++def test_a_harness_without_those_plugs_gets_no_section():+ assert gw._agent_doc_with_plugs("Be brief.", []) == "Be brief."+ assert "## Vercel" not in gw._agent_doc_with_plugs("", ["browser"])diff --git a/gateway/tests/test_plugs.py b/gateway/tests/test_plugs.pyindex 4a296a51..e8b636c2 100644--- a/gateway/tests/test_plugs.py+++ b/gateway/tests/test_plugs.py@@ -120,6 +120,11 @@ class Vendor:return httpx.Response(201, json=json.loads(r.content))if path == "/api/health":return httpx.Response(200, json={"status": "ok"})+ if path == "/api/database/tables/orders/schema" and r.method == "GET":+ return httpx.Response(200, json={"tableName": "orders", "columns": [{"columnName": "status", "type": "string"}]})+ if path.startswith("/api/database/tables/") and r.method == "GET":+ # what the real backend answers on a path it does not route: its not-found page+ return httpx.Response(404, text="<!DOCTYPE html>\n<html lang=\"en\"><head><title>Not found</title></head></html>")return httpx.Response(404, text=f"no mock for {path}")return httpx.Response(500, text=f"unexpected host {host}")@@ -435,6 +440,11 @@ def test_push_files_deploy_and_insert_drive_the_vendors_as_documented(world):out = json.loads(asyncio.run(plugs_plane.call("insforge", "insert_rows", {"table": "orders", "rows": [{"status": "new"}]},{"api_key": INF_KEY}, _record("insforge")["config"])))assert out == [{"status": "new"}]+ # a table's columns live at the vendor's /schema route; the path without it is its not-found page+ out = json.loads(asyncio.run(plugs_plane.call("insforge", "describe_table", {"table": "orders"}, {"api_key": INF_KEY},+ _record("insforge")["config"])))+ assert out["columns"] == [{"columnName": "status", "type": "string"}]+ assert ven.calls[-1].url.path == "/api/database/tables/orders/schema"with pytest.raises(plugs_plane.PlugToolError):asyncio.run(plugs_plane.call("insforge", "delete_rows", {"table": "orders", "filters": {}}, {"api_key": INF_KEY},_record("insforge")["config"]))