From 106c208553859679381bbaaab0c5a0b03cbe3abc Mon Sep 17 00:00:00 2001 From: raman325 <7243222+raman325@users.noreply.github.com> Date: Tue, 1 Sep 2026 00:36:29 -0400 Subject: [PATCH] test(server): extend Hermes settings and probe coverage Mirrors Hermes into the settings restore/disable fixtures alongside Grok and OpenCode, drops the tautological HERMES_AUTH_METHOD_ID unit test and un-exports the now test-only constant, and gates the Hermes ACP probe's live-turn test behind T3_HERMES_LIVE_TURN, matching the Grok probe's T3_GROK_LIVE_TURN gate. Co-Authored-By: Claude Opus 5 (1M context) --- .../src/provider/acp/HermesAcpCliProbe.test.ts | 3 ++- .../server/src/provider/acp/HermesAcpSupport.test.ts | 12 +----------- apps/server/src/provider/acp/HermesAcpSupport.ts | 2 +- apps/server/src/serverSettings.test.ts | 11 ++++++++--- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/apps/server/src/provider/acp/HermesAcpCliProbe.test.ts b/apps/server/src/provider/acp/HermesAcpCliProbe.test.ts index eccba0eecd..31f1628ad2 100644 --- a/apps/server/src/provider/acp/HermesAcpCliProbe.test.ts +++ b/apps/server/src/provider/acp/HermesAcpCliProbe.test.ts @@ -1,6 +1,7 @@ /** * Optional integration check against a real `hermes acp` install. * Enable with: T3_HERMES_ACP_PROBE=1 vp test run HermesAcpCliProbe + * Set T3_HERMES_LIVE_TURN=1 to also send a small prompt to the real model. * * Set T3_HERMES_ACP_PROBE_BINARY to run a hermes binary that is not on * PATH (a wrapper script that proxies stdio to a remote install works, @@ -56,7 +57,7 @@ describe.runIf(process.env.T3_HERMES_ACP_PROBE === "1")("Hermes ACP CLI probe", // Hermes spends a long thinking phase on even trivial prompts, so a real // turn regularly exceeds the suite's default test timeout. The probe is // env-gated and never runs in CI, so a generous explicit budget is safe. - it.effect( + it.effect.skipIf(process.env.T3_HERMES_LIVE_TURN !== "1")( "finishes a real Hermes turn and streams its answer", () => Effect.gen(function* () { diff --git a/apps/server/src/provider/acp/HermesAcpSupport.test.ts b/apps/server/src/provider/acp/HermesAcpSupport.test.ts index 52a0165ce4..54d51e1eb8 100644 --- a/apps/server/src/provider/acp/HermesAcpSupport.test.ts +++ b/apps/server/src/provider/acp/HermesAcpSupport.test.ts @@ -2,11 +2,7 @@ import { describe, expect, it } from "@effect/vitest"; import * as Effect from "effect/Effect"; import * as EffectAcpErrors from "effect-acp/errors"; -import { - applyHermesAcpModelSelection, - buildHermesAcpSpawnInput, - HERMES_AUTH_METHOD_ID, -} from "./HermesAcpSupport.ts"; +import { applyHermesAcpModelSelection, buildHermesAcpSpawnInput } from "./HermesAcpSupport.ts"; describe("buildHermesAcpSpawnInput", () => { it("spawns the configured binary with the acp subcommand", () => { @@ -44,12 +40,6 @@ describe("buildHermesAcpSpawnInput", () => { }); }); -describe("HERMES_AUTH_METHOD_ID", () => { - it("targets the Hermes custom-credentials auth method", () => { - expect(HERMES_AUTH_METHOD_ID).toBe("custom"); - }); -}); - describe("applyHermesAcpModelSelection", () => { it.effect("passes the model id to session/set_model verbatim", () => Effect.gen(function* () { diff --git a/apps/server/src/provider/acp/HermesAcpSupport.ts b/apps/server/src/provider/acp/HermesAcpSupport.ts index 0675d9bc91..29bbab4efc 100644 --- a/apps/server/src/provider/acp/HermesAcpSupport.ts +++ b/apps/server/src/provider/acp/HermesAcpSupport.ts @@ -9,7 +9,7 @@ import * as EffectAcpErrors from "effect-acp/errors"; import * as AcpSessionRuntime from "./AcpSessionRuntime.ts"; /** Auth method advertised by `hermes acp` for pre-configured runtime credentials. */ -export const HERMES_AUTH_METHOD_ID = "custom"; +const HERMES_AUTH_METHOD_ID = "custom"; type HermesAcpRuntimeHermesSettings = Pick; diff --git a/apps/server/src/serverSettings.test.ts b/apps/server/src/serverSettings.test.ts index d435759eca..20e25d8baa 100644 --- a/apps/server/src/serverSettings.test.ts +++ b/apps/server/src/serverSettings.test.ts @@ -586,10 +586,11 @@ it.layer(NodeServices.layer)("server settings", (it) => { const serverSettings = yield* ServerSettingsModule.ServerSettingsService; yield* fileSystem.writeFileString( serverConfig.settingsPath, - '{"providerInstances":{"cursor_work":{"driver":"cursor","config":{}},"grok":{"driver":"grok","config":{}},"opencode_work":{"driver":"opencode","config":{"serverUrl":"http://127.0.0.1:4096"}},"opencode_unused":{"driver":"opencode","config":{}}}}', + '{"providerInstances":{"cursor_work":{"driver":"cursor","config":{}},"grok":{"driver":"grok","config":{}},"hermes":{"driver":"hermes","config":{}},"opencode_work":{"driver":"opencode","config":{"serverUrl":"http://127.0.0.1:4096"}},"opencode_unused":{"driver":"opencode","config":{}}}}', ); yield* recordProviderUsage("cursor", "cursor_work"); yield* recordProviderUsage("grok", null); + yield* recordProviderUsage("hermes", null); yield* recordProviderUsage("opencode", "opencode_work"); const settings = yield* serverSettings.getSettings; @@ -597,6 +598,7 @@ it.layer(NodeServices.layer)("server settings", (it) => { assert.isTrue(settings.providers.cursor.enabled); assert.isTrue(settings.providerInstances[ProviderInstanceId.make("cursor_work")]?.enabled); assert.isTrue(settings.providerInstances[ProviderInstanceId.make("grok")]?.enabled); + assert.isTrue(settings.providerInstances[ProviderInstanceId.make("hermes")]?.enabled); assert.isTrue(settings.providerInstances[ProviderInstanceId.make("opencode_work")]?.enabled); const unused = settings.providerInstances[ProviderInstanceId.make("opencode_unused")]; assert.isDefined(unused); @@ -611,18 +613,21 @@ it.layer(NodeServices.layer)("server settings", (it) => { const serverSettings = yield* ServerSettingsModule.ServerSettingsService; yield* fileSystem.writeFileString( serverConfig.settingsPath, - '{"providers":{"grok":{"enabled":false},"opencode":{"enabled":false},"cursor":{"enabled":false}},"providerInstances":{"grok":{"driver":"grok","enabled":false,"config":{}},"opencode":{"driver":"opencode","config":{"enabled":false}},"cursor":{"driver":"cursor","enabled":false,"config":{}}}}', + '{"providers":{"grok":{"enabled":false},"hermes":{"enabled":false},"opencode":{"enabled":false},"cursor":{"enabled":false}},"providerInstances":{"grok":{"driver":"grok","enabled":false,"config":{}},"hermes":{"driver":"hermes","enabled":false,"config":{}},"opencode":{"driver":"opencode","config":{"enabled":false}},"cursor":{"driver":"cursor","enabled":false,"config":{}}}}', ); yield* recordProviderUsage("grok"); + yield* recordProviderUsage("hermes"); yield* recordProviderUsage("opencode"); yield* recordProviderUsage("cursor"); const settings = yield* serverSettings.getSettings; assert.isFalse(settings.providers.grok.enabled); + assert.isFalse(settings.providers.hermes.enabled); assert.isFalse(settings.providers.opencode.enabled); assert.isFalse(settings.providers.cursor.enabled); assert.isFalse(settings.providerInstances[ProviderInstanceId.make("grok")]?.enabled); + assert.isFalse(settings.providerInstances[ProviderInstanceId.make("hermes")]?.enabled); assert.isFalse(settings.providerInstances[ProviderInstanceId.make("opencode")]?.enabled); assert.isFalse(settings.providerInstances[ProviderInstanceId.make("cursor")]?.enabled); }).pipe(Effect.provide(makeServerSettingsLayer())), @@ -656,7 +661,7 @@ it.layer(NodeServices.layer)("server settings", (it) => { }).pipe(Effect.provide(makeServerSettingsLayer())), ); - it.effect("preserves provider history when no settings file exists for hermes", () => + it.effect("restores hermes from provider history when no settings file exists", () => Effect.gen(function* () { const serverSettings = yield* ServerSettingsModule.ServerSettingsService; yield* recordProviderUsage("hermes");