feat: surface the Hermes model on instance status

`connection.hello` gained an optional `model` field, but the value died in
the broker: `HermesGatewayInstanceStatus` carried pluginVersion and
hermesVersion with nowhere for the model to go, so the provider picker had
no way to name the model Hermes actually runs.

Add `model` to the status struct as a required nullable field. Null covers
both "no plugin has connected yet" and "the connected plugin predates the
field" — the plugin ships separately from the server, so a plugin that
never sends it must still complete the handshake rather than failing the
frame decoder. Tests cover the present and absent paths on both the hello
frame and the status projection.

The model is volatile liveness, not durable config: it belongs in broker
memory alongside pluginVersion/hermesVersion/capabilities and is never
persisted to settings.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Ben DavisandClaude Opus 5 committed 2026-07-24 22:26:05 -07:00
1 parent 5b519775f5
commit e8be967295
2 files changed
+44

No files matched your search

@@ -69,6 +69,7 @@ describe("Hermes gateway management contracts", () => {
lastConnectedAt: "2026-07-23T12:00:00.000Z",
pluginVersion: "0.2.0",
hermesVersion: "1.2.3",
model: "gpt-5.6-terra",
activeSessionCount: 2,
protocolVersion: 2,
capabilities: {
@@ -82,6 +83,12 @@ describe("Hermes gateway management contracts", () => {
});
expect(connected.status).toBe("connected");
expect(connected.activeSessionCount).toBe(2);
expect(connected.model).toBe("gpt-5.6-terra");
// A plugin that predates the `model` field still produces a valid status;
// the picker falls back to the generic label rather than failing to decode.
const withoutModel = decodeInstanceStatus({ ...connected, model: null });
expect(withoutModel.model).toBeNull();
const upgradeRequired = decodeInstanceStatus({
...connected,
@@ -134,6 +141,7 @@ describe("Hermes gateway handshake", () => {
userInput: true,
attachments: false,
},
model: "gpt-5.6-terra",
authentication: {
type: "instance-credential",
instanceId: "hermes-research",
@@ -142,6 +150,35 @@ describe("Hermes gateway handshake", () => {
});
expect(hello.authentication.type).toBe("instance-credential");
expect(hello.model).toBe("gpt-5.6-terra");
});
// The plugin ships separately from the server, so a plugin that predates the
// `model` field must still complete the handshake rather than failing the
// frame decoder. T3 falls back to the generic model label.
it("accepts a hello from a plugin that reports no model", () => {
const hello = decodeHello({
type: "connection.hello",
requestId: "hello-no-model",
protocolVersion: 2,
pluginVersion: "0.2.0",
hermesVersion: "1.2.3",
capabilities: {
protocolVersion: 2,
streaming: true,
activity: true,
approvals: true,
userInput: true,
attachments: false,
},
authentication: {
type: "instance-credential",
instanceId: "hermes-research",
credential: "persistent-secret",
},
});
expect(hello.model).toBeUndefined();
});
it("decodes a future-version hello so the broker can reject it explicitly", () => {
+7
View File
@@ -123,6 +123,13 @@ export const HermesGatewayInstanceStatus = Schema.Struct({
lastConnectedAt: Schema.NullOr(IsoDateTime),
pluginVersion: Schema.NullOr(TrimmedNonEmptyString),
hermesVersion: Schema.NullOr(TrimmedNonEmptyString),
/**
* The model the connected plugin reported at handshake, surfaced so the
* provider picker can name the model Hermes actually runs instead of a
* placeholder. Null when no plugin has connected yet, or when the connected
* plugin predates the `model` field on `connection.hello`.
*/
model: Schema.NullOr(TrimmedNonEmptyString),
activeSessionCount: NonNegativeInt,
protocolVersion: Schema.NullOr(PositiveInt),
capabilities: Schema.NullOr(HermesGatewayCapabilities),