From 25db3dee59ffbf56eba48bd3331848b759a7f563 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Date: Fri, 29 May 2026 00:57:30 -0300 Subject: [PATCH] fix(cli): register openclaw in tool-detector (#2833) (#2850) Integrated into release/v3.8.6. --- CHANGELOG.md | 1 + src/lib/cli-helper/tool-detector.ts | 2 ++ tests/unit/cli-helper/tool-detector.test.ts | 30 +++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b56334bcfb..250ae6de78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - **combos:** fix combo handling so transient 429 rate limit errors do not poison or persist the rate limited state for the same-provider connection (#2800 โ€” thanks @apoapostolov) - **gemini:** translate signature-less Gemini thinking model tool calls to text parts to prevent `400 "missing thought_signature"` errors (#2801 โ€” thanks @herjarsa) - **warning-cleanup:** relax node engine constraint to `>=22.0.0` and clean dependencies (keeping `marked-terminal` to prevent TUI REPL crash) (#2792 โ€” thanks @oyi77) +- **fix(cli):** register openclaw in the CLI tool-detector so it appears in `omniroute status` alongside its existing API and config support ([#2833](https://github.com/diegosouzapw/OmniRoute/issues/2833)) ### ๐Ÿงน Chores diff --git a/src/lib/cli-helper/tool-detector.ts b/src/lib/cli-helper/tool-detector.ts index 29ac02eba6..59078e754f 100644 --- a/src/lib/cli-helper/tool-detector.ts +++ b/src/lib/cli-helper/tool-detector.ts @@ -40,6 +40,7 @@ const TOOLS = [ { id: "continue", name: "Continue", configPath: "~/.continue/config.yaml" }, { id: "hermes", name: "Hermes", configPath: "~/.hermes/config.yaml" }, { id: "hermes-agent", name: "Hermes Agent", configPath: "~/.hermes/config.yaml" }, + { id: "openclaw", name: "OpenClaw", configPath: "~/.openclaw/openclaw.json" }, ] as const; const BINARY_NAMES: Record = { @@ -51,6 +52,7 @@ const BINARY_NAMES: Record = { continue: "continue", hermes: "hermes", "hermes-agent": "hermes", + openclaw: "openclaw", }; function expandHome(p: string): string { diff --git a/tests/unit/cli-helper/tool-detector.test.ts b/tests/unit/cli-helper/tool-detector.test.ts index db8e03cf0d..c32f0fa93a 100644 --- a/tests/unit/cli-helper/tool-detector.test.ts +++ b/tests/unit/cli-helper/tool-detector.test.ts @@ -13,6 +13,9 @@ describe("tool-detector", () => { if (cmd === "hermes") { return { stdout: "v0.75.3\n" }; } + if (cmd === "openclaw") { + return { stdout: "v0.3.1\n" }; + } if (cmd === "which") { return { stdout: "/usr/local/bin/opencode\n" }; } @@ -47,6 +50,21 @@ describe("tool-detector", () => { assert.ok(result!.configPath.includes(".hermes/config.yaml")); assert.strictEqual(typeof result!.configured, "boolean"); }); + + // Regression test for #2833 โ€” openclaw was missing from TOOLS array + it("returns DetectedTool object for openclaw with the openclaw config path", async () => { + const result = await toolDetector.detectTool("openclaw"); + assert.ok(result !== null, "detectTool('openclaw') must not return null"); + assert.strictEqual(result!.id, "openclaw"); + assert.strictEqual(result!.name, "OpenClaw"); + assert.strictEqual(result!.installed, true); + assert.strictEqual(result!.version, "0.3.1"); + assert.ok( + result!.configPath.includes(".openclaw/openclaw.json"), + `expected configPath to include '.openclaw/openclaw.json', got: ${result!.configPath}`, + ); + assert.strictEqual(typeof result!.configured, "boolean"); + }); }); describe("detectAllTools", () => { @@ -62,5 +80,17 @@ describe("tool-detector", () => { assert.ok("configured" in t); } }); + + // Regression test for #2833 โ€” openclaw must appear in detectAllTools() + it("includes openclaw in the detected tools list", async () => { + const tools = await toolDetector.detectAllTools(); + const openclaw = tools.find((t) => t.id === "openclaw"); + assert.ok(openclaw !== undefined, "detectAllTools() must include an entry with id='openclaw'"); + assert.strictEqual(openclaw!.name, "OpenClaw"); + assert.ok( + openclaw!.configPath.includes(".openclaw/openclaw.json"), + `expected configPath to include '.openclaw/openclaw.json', got: ${openclaw!.configPath}`, + ); + }); }); });