mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-24 00:58:39 +00:00
feat(heartbeat): add directPolicy and restore default direct delivery
This commit is contained in:
@@ -234,4 +234,32 @@ describe("config plugin validation", () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it("accepts heartbeat directPolicy enum values", async () => {
|
||||
const home = await createCaseHome();
|
||||
const res = validateInHome(home, {
|
||||
agents: {
|
||||
defaults: { heartbeat: { target: "last", directPolicy: "block" } },
|
||||
list: [{ id: "pi", heartbeat: { directPolicy: "allow" } }],
|
||||
},
|
||||
});
|
||||
expect(res.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects invalid heartbeat directPolicy values", async () => {
|
||||
const home = await createCaseHome();
|
||||
const res = validateInHome(home, {
|
||||
agents: {
|
||||
defaults: { heartbeat: { directPolicy: "maybe" } },
|
||||
list: [{ id: "pi" }],
|
||||
},
|
||||
});
|
||||
expect(res.ok).toBe(false);
|
||||
if (!res.ok) {
|
||||
const hasIssue = res.issues.some(
|
||||
(issue) => issue.path === "agents.defaults.heartbeat.directPolicy",
|
||||
);
|
||||
expect(hasIssue).toBe(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user