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) <[email protected]>
This commit is contained in:
raman325andClaude Opus 5 committed 2026-09-02 14:43:57 -04:00
1 parent 1c84a54a80
commit 106c208553
4 files changed
+12 -16

No files matched your search

@@ -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* () {
@@ -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* () {
@@ -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<HermesSettings, "binaryPath">;
+8 -3
View File
@@ -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");