mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 05:24:32 +00:00
fix(gateway): restart heartbeat on model config changes
This commit is contained in:
@@ -147,6 +147,18 @@ describe("buildGatewayReloadPlan", () => {
|
|||||||
expect(plan.restartChannels).toEqual(expected);
|
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", () => {
|
it("treats gateway.remote as no-op", () => {
|
||||||
const plan = buildGatewayReloadPlan(["gateway.remote.url"]);
|
const plan = buildGatewayReloadPlan(["gateway.remote.url"]);
|
||||||
expect(plan.restartGateway).toBe(false);
|
expect(plan.restartGateway).toBe(false);
|
||||||
|
|||||||
@@ -59,6 +59,16 @@ const BASE_RELOAD_RULES: ReloadRule[] = [
|
|||||||
kind: "hot",
|
kind: "hot",
|
||||||
actions: ["restart-heartbeat"],
|
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: "agent.heartbeat", kind: "hot", actions: ["restart-heartbeat"] },
|
||||||
{ prefix: "cron", kind: "hot", actions: ["restart-cron"] },
|
{ prefix: "cron", kind: "hot", actions: ["restart-cron"] },
|
||||||
{
|
{
|
||||||
@@ -73,7 +83,6 @@ const BASE_RELOAD_RULES_TAIL: ReloadRule[] = [
|
|||||||
{ prefix: "identity", kind: "none" },
|
{ prefix: "identity", kind: "none" },
|
||||||
{ prefix: "wizard", kind: "none" },
|
{ prefix: "wizard", kind: "none" },
|
||||||
{ prefix: "logging", kind: "none" },
|
{ prefix: "logging", kind: "none" },
|
||||||
{ prefix: "models", kind: "none" },
|
|
||||||
{ prefix: "agents", kind: "none" },
|
{ prefix: "agents", kind: "none" },
|
||||||
{ prefix: "tools", kind: "none" },
|
{ prefix: "tools", kind: "none" },
|
||||||
{ prefix: "bindings", kind: "none" },
|
{ prefix: "bindings", kind: "none" },
|
||||||
|
|||||||
Reference in New Issue
Block a user