From ef32d8eb2c444c5ab56b2bc84454aad8f5bbf298 Mon Sep 17 00:00:00 2001 From: eastagiletracker <310448263+eastagiletracker@users.noreply.github.com> Date: Wed, 14 Oct 2026 12:32:39 +0700 Subject: [PATCH] fix(cli): accept --runtime hermes_moa in the provider registry runtime_registry.py added the hermes_moa runtime, but the CLI's PROVIDER_IDS was never extended, so `speca run --runtime hermes_moa` exited 2 with "unknown runtime" before spawning the orchestrator, and the provider-id drift test in providers.registry.test.ts was red. Hermes owns the credential pool and the proxy, so the CLI descriptor has no env keys to check; the hermes-on-PATH probe stays on the Python side. --- cli/src/lib/providers/registry.ts | 11 +++++++++++ cli/test/providers.registry.test.ts | 2 +- cli/test/run.command.test.ts | 17 +++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/cli/src/lib/providers/registry.ts b/cli/src/lib/providers/registry.ts index 50d9916a..49ba3de1 100644 --- a/cli/src/lib/providers/registry.ts +++ b/cli/src/lib/providers/registry.ts @@ -25,6 +25,7 @@ export const PROVIDER_IDS = [ "ollama", "copilot", "claude_pty", + "hermes_moa", ] as const; export type ProviderId = (typeof PROVIDER_IDS)[number]; @@ -142,6 +143,16 @@ export const PROVIDERS: Record = { // Python side at runner construction, where the actionable error lives. validate: () => ok(), }, + hermes_moa: { + id: "hermes_moa", + summary: + "Mixture-of-Agents: 3 ollama-cloud models via the Hermes proxy, " + + "recall-first union+cross-verify (speca#88).", + // Hermes owns the provider credential pool and the proxy, so there is no + // speca-side key to check. Whether `hermes` is on PATH is probed by + // runtime_registry.py::_probe_hermes_moa, where the actionable error lives. + validate: () => ok(), + }, }; export function isProviderId(value: string): value is ProviderId { diff --git a/cli/test/providers.registry.test.ts b/cli/test/providers.registry.test.ts index 56450455..bd1895ce 100644 --- a/cli/test/providers.registry.test.ts +++ b/cli/test/providers.registry.test.ts @@ -144,7 +144,7 @@ describe("validateRuntime — API-key providers", () => { }); describe("validateRuntime — CLI-managed providers", () => { - it.each([["claude"], ["copilot"], ["claude_pty"]] as const)( + it.each([["claude"], ["copilot"], ["claude_pty"], ["hermes_moa"]] as const)( "%s needs no env credentials", (id) => { expect(validateRuntime(id, {}).ok).toBe(true); diff --git a/cli/test/run.command.test.ts b/cli/test/run.command.test.ts index b72bb1ab..9eed37ad 100644 --- a/cli/test/run.command.test.ts +++ b/cli/test/run.command.test.ts @@ -343,6 +343,23 @@ describe("runRunCommand — --runtime selection (#113)", () => { expect(seenRuntime).toBe("ollama"); }); + it("forwards hermes_moa (registered in runtime_registry.py) into the spawn options", async () => { + let seenRuntime: string | undefined; + const code = await runRunCommand({ + flags: { phase: ["02c"], noTui: true, runtime: "hermes_moa" }, + cwd, + spawn: ((opts) => { + seenRuntime = opts.runtime; + return fakeSpawnDependencyFailure()(opts); + }) as typeof spawnPipeline, + startLogs: async () => async () => {}, + skipPreflight: true, + }); + expect(code).toBe(1); // fake pipeline's dependency-failure exit + expect(seenRuntime).toBe("hermes_moa"); + expect(stderrCapture.chunks.join("")).not.toContain("unknown runtime"); + }); + it("leaves runtime undefined when the flag is absent (default unchanged)", async () => { let seenRuntime: string | undefined = "sentinel"; await runRunCommand({