fix(contracts): give Hermes a default model for text generation

Hermes had no DEFAULT_MODEL_BY_PROVIDER entry, so a Hermes-only install
fell through to the Codex text-generation slug (gpt-5.6-luna). The
adapter forwards any non-sentinel id to session/set_model, which the
real CLI rejects, breaking generated titles, commit messages, PR text,
and branch names.

Mirrors Grok: the entry is the product slug the adapter already treats
as "keep the session's configured model" and skips set_model for.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
raman325andClaude Opus 5 committed 2026-09-02 15:18:04 -04:00
1 parent a54fe4e34d
commit 8c12290a17
2 files changed
+25

No files matched your search

+21
View File
@@ -741,6 +741,27 @@ it.layer(NodeServices.layer)("server settings", (it) => {
}).pipe(Effect.provide(makeServerSettingsLayer())),
);
it.effect("falls back to the Hermes session model when only Hermes is enabled", () =>
Effect.gen(function* () {
const serverSettings = yield* ServerSettingsModule.ServerSettingsService;
const settings = yield* serverSettings.updateSettings({
providers: {
codex: { enabled: false },
claudeAgent: { enabled: false },
hermes: { enabled: true },
},
});
// "default" is Hermes's product slug, not an ACP model id: the adapter
// skips session/set_model for it and keeps Hermes's configured model.
// Without a DEFAULT_MODEL_BY_PROVIDER entry the fallback would hand
// Hermes the Codex text-generation slug, which Hermes rejects.
assert.deepEqual(settings.textGenerationModelSelection.instanceId, "hermes");
assert.deepEqual(settings.textGenerationModelSelection.model, "default");
}).pipe(Effect.provide(makeServerSettingsLayer())),
);
it.effect("persists explicit disables after a provider has been used", () =>
Effect.gen(function* () {
const serverConfig = yield* ServerConfig.ServerConfig;
+4
View File
@@ -131,6 +131,7 @@ const CODEX_DRIVER_KIND = ProviderDriverKind.make("codex");
const CLAUDE_DRIVER_KIND = ProviderDriverKind.make("claudeAgent");
const CURSOR_DRIVER_KIND = ProviderDriverKind.make("cursor");
const GROK_DRIVER_KIND = ProviderDriverKind.make("grok");
const HERMES_DRIVER_KIND = ProviderDriverKind.make("hermes");
const OPENCODE_DRIVER_KIND = ProviderDriverKind.make("opencode");
export const DEFAULT_MODEL = "gpt-5.6-sol";
@@ -153,6 +154,9 @@ export const DEFAULT_MODEL_BY_PROVIDER: Partial<Record<ProviderDriverKind, strin
[CURSOR_DRIVER_KIND]: "auto",
// Product slug, not an ACP model id. The Grok adapter treats it as "the session's current model".
[GROK_DRIVER_KIND]: "grok-build",
// Product slug, not an ACP model id. The Hermes adapter treats it as "keep the
// model Hermes is configured with" and skips session/set_model for it.
[HERMES_DRIVER_KIND]: "default",
[OPENCODE_DRIVER_KIND]: "openai/gpt-5",
};