mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 22:09:57 +00:00
fix(config): detect top-level heartbeat as invalid config path (#30894)
Top-level `heartbeat` is not a valid config path but was silently ignored, causing users to believe heartbeat.model was configured when it was not. Add a legacy config rule so startup validation surfaces a clear migration hint pointing to agents.defaults.heartbeat. Fixes #30894
This commit is contained in:
committed by
Gustavo Madeira Santana
parent
b7589b32a8
commit
b8d4888f3b
@@ -274,6 +274,15 @@ describe("legacy config detection", () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
it("flags top-level heartbeat as legacy in snapshot", async () => {
|
||||
await withSnapshotForConfig(
|
||||
{ heartbeat: { model: "anthropic/claude-3-5-haiku-20241022", every: "30m" } },
|
||||
async (ctx) => {
|
||||
expect(ctx.snapshot.valid).toBe(false);
|
||||
expect(ctx.snapshot.legacyIssues.some((issue) => issue.path === "heartbeat")).toBe(true);
|
||||
},
|
||||
);
|
||||
});
|
||||
it("flags legacy provider sections in snapshot", async () => {
|
||||
await withSnapshotForConfig({ whatsapp: { allowFrom: ["+1555"] } }, async (ctx) => {
|
||||
expect(ctx.snapshot.valid).toBe(false);
|
||||
|
||||
@@ -204,4 +204,9 @@ export const LEGACY_CONFIG_RULES: LegacyConfigRule[] = [
|
||||
match: (value) => isLegacyGatewayBindHostAlias(value),
|
||||
requireSourceLiteral: true,
|
||||
},
|
||||
{
|
||||
path: ["heartbeat"],
|
||||
message:
|
||||
"top-level heartbeat is not a valid config path; use agents.defaults.heartbeat instead.",
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user