Skip to content

Commit 8c12290

Browse files
raman325claude
andcommitted
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]>
1 parent a54fe4e commit 8c12290

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎apps/server/src/serverSettings.test.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,27 @@ it.layer(NodeServices.layer)("server settings", (it) => {
741741
}).pipe(Effect.provide(makeServerSettingsLayer())),
742742
);
743743

744+
it.effect("falls back to the Hermes session model when only Hermes is enabled", () =>
745+
Effect.gen(function* () {
746+
const serverSettings = yield* ServerSettingsModule.ServerSettingsService;
747+
748+
const settings = yield* serverSettings.updateSettings({
749+
providers: {
750+
codex: { enabled: false },
751+
claudeAgent: { enabled: false },
752+
hermes: { enabled: true },
753+
},
754+
});
755+
756+
// "default" is Hermes's product slug, not an ACP model id: the adapter
757+
// skips session/set_model for it and keeps Hermes's configured model.
758+
// Without a DEFAULT_MODEL_BY_PROVIDER entry the fallback would hand
759+
// Hermes the Codex text-generation slug, which Hermes rejects.
760+
assert.deepEqual(settings.textGenerationModelSelection.instanceId, "hermes");
761+
assert.deepEqual(settings.textGenerationModelSelection.model, "default");
762+
}).pipe(Effect.provide(makeServerSettingsLayer())),
763+
);
764+
744765
it.effect("persists explicit disables after a provider has been used", () =>
745766
Effect.gen(function* () {
746767
const serverConfig = yield* ServerConfig.ServerConfig;

‎packages/contracts/src/model.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ const CODEX_DRIVER_KIND = ProviderDriverKind.make("codex");
131131
const CLAUDE_DRIVER_KIND = ProviderDriverKind.make("claudeAgent");
132132
const CURSOR_DRIVER_KIND = ProviderDriverKind.make("cursor");
133133
const GROK_DRIVER_KIND = ProviderDriverKind.make("grok");
134+
const HERMES_DRIVER_KIND = ProviderDriverKind.make("hermes");
134135
const OPENCODE_DRIVER_KIND = ProviderDriverKind.make("opencode");
135136

136137
export const DEFAULT_MODEL = "gpt-5.6-sol";
@@ -153,6 +154,9 @@ export const DEFAULT_MODEL_BY_PROVIDER: Partial<Record<ProviderDriverKind, strin
153154
[CURSOR_DRIVER_KIND]: "auto",
154155
// Product slug, not an ACP model id. The Grok adapter treats it as "the session's current model".
155156
[GROK_DRIVER_KIND]: "grok-build",
157+
// Product slug, not an ACP model id. The Hermes adapter treats it as "keep the
158+
// model Hermes is configured with" and skips session/set_model for it.
159+
[HERMES_DRIVER_KIND]: "default",
156160
[OPENCODE_DRIVER_KIND]: "openai/gpt-5",
157161
};
158162

0 commit comments

Comments
 (0)