diff --git a/src/gateway/config-reload.test.ts b/src/gateway/config-reload.test.ts index 8eee9df30..ad36dcc75 100644 --- a/src/gateway/config-reload.test.ts +++ b/src/gateway/config-reload.test.ts @@ -147,6 +147,18 @@ describe("buildGatewayReloadPlan", () => { expect(plan.restartChannels).toEqual(expected); }); + it("restarts heartbeat when model-related config changes", () => { + const plan = buildGatewayReloadPlan([ + "models.providers.openai.models", + "agents.defaults.model", + ]); + expect(plan.restartGateway).toBe(false); + expect(plan.restartHeartbeat).toBe(true); + expect(plan.hotReasons).toEqual( + expect.arrayContaining(["models.providers.openai.models", "agents.defaults.model"]), + ); + }); + it("treats gateway.remote as no-op", () => { const plan = buildGatewayReloadPlan(["gateway.remote.url"]); expect(plan.restartGateway).toBe(false); diff --git a/src/gateway/config-reload.ts b/src/gateway/config-reload.ts index a1a89717a..ff2eebc1f 100644 --- a/src/gateway/config-reload.ts +++ b/src/gateway/config-reload.ts @@ -59,6 +59,16 @@ const BASE_RELOAD_RULES: ReloadRule[] = [ kind: "hot", actions: ["restart-heartbeat"], }, + { + prefix: "agents.defaults.model", + kind: "hot", + actions: ["restart-heartbeat"], + }, + { + prefix: "models", + kind: "hot", + actions: ["restart-heartbeat"], + }, { prefix: "agent.heartbeat", kind: "hot", actions: ["restart-heartbeat"] }, { prefix: "cron", kind: "hot", actions: ["restart-cron"] }, { @@ -73,7 +83,6 @@ const BASE_RELOAD_RULES_TAIL: ReloadRule[] = [ { prefix: "identity", kind: "none" }, { prefix: "wizard", kind: "none" }, { prefix: "logging", kind: "none" }, - { prefix: "models", kind: "none" }, { prefix: "agents", kind: "none" }, { prefix: "tools", kind: "none" }, { prefix: "bindings", kind: "none" },