From 255e5110217e0d1cbd4e697b1e2239a75102a193 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Tue, 6 Oct 2026 09:43:47 +0100 Subject: [PATCH] fix(bridge): accurate rest-unavailable message; one version source - boj_health's rest-unavailable text said "pending Elixir rewrite" and named a `boj-server.service` unit that does not exist. The Elixir backend (elixir/, boj_rest) exists; the unit is boj-rest.service. The message now says how to start it (`just run` / `just install-service`) and which tools need it. - dispatcher.js carried its own SERVER_NAME/SERVER_VERSION copy, duplicating lib/version.js ("single source of truth"). It now imports from version.js. The version values themselves are unchanged (release numbering is the owner's call: package.json 0.5.0 vs jsr.json/version.js 0.4.7). Tests: node --test mcp-bridge/tests/dispatch_test.js 15/15; live stdio boj_health against a closed port returns the new text. Co-Authored-By: Claude Opus 5.5 --- mcp-bridge/lib/api-clients.js | 8 ++++++-- mcp-bridge/lib/dispatcher.js | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mcp-bridge/lib/api-clients.js b/mcp-bridge/lib/api-clients.js index 3261ffa0..0b392f4a 100644 --- a/mcp-bridge/lib/api-clients.js +++ b/mcp-bridge/lib/api-clients.js @@ -20,7 +20,11 @@ const GITLAB_BASE = env.get("GITLAB_URL") ?? "https://gitlab.com"; // BoJ REST API wrappers // =================================================================== -/** @returns {Promise} */ +/** + * Report backend liveness: the REST /health payload plus per-cartridge status, + * or a structured "rest-unavailable" result when the backend cannot be reached. + * @returns {Promise} + */ async function fetchHealth() { try { const res = await fetch(`${BOJ_BASE}/health`); @@ -52,7 +56,7 @@ async function fetchHealth() { return { status: "rest-unavailable", mode: "stdio-only", - message: "BoJ REST API is not currently deployed — pending Elixir rewrite. The systemd unit `boj-server.service` starts the stdio MCP bridge, not a REST server on " + BOJ_BASE + ". Offline-capable tools (menu, cartridges, cartridge-info) still work via static fallbacks; REST-only tools (health, invoke, research, codeseeker) will return this error until the Elixir port ships.", + message: "BoJ REST backend is not reachable at " + BOJ_BASE + ". It is the Elixir app in elixir/ (boj_rest): start it with `just run` (cd elixir && mix run --no-halt) or install the `boj-rest.service` user unit with `just install-service`; set BOJ_URL if it listens elsewhere. Offline-capable tools (menu, cartridges, cartridge-info, github, gitlab) still work; backend-only tools (invoke, research, codeseeker, cloud, comms, browser) fail until it is up.", base_url_probed: BOJ_BASE, }; } diff --git a/mcp-bridge/lib/dispatcher.js b/mcp-bridge/lib/dispatcher.js index a6df0037..b535586e 100644 --- a/mcp-bridge/lib/dispatcher.js +++ b/mcp-bridge/lib/dispatcher.js @@ -38,8 +38,7 @@ import * as pathClaims from "./path-claims.js"; import { info, warn, error as logError, setLevel as setLogLevel } from "./logger.js"; import * as otel from "./otel.js"; -const SERVER_NAME = "boj-server"; -const SERVER_VERSION = "0.4.7"; +import { SERVER_NAME, SERVER_VERSION } from "./version.js"; const LOCAL_COORD_URL = env.get("COORD_BACKEND_URL") ?? "http://127.0.0.1:7745"; const ENVELOPE_CARRYING_TOOLS = new Set(["coord_send", "coord_send_gated"]);