mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 00:00:23 +00:00
cron: separate webhook POST delivery from announce (#17901)
* cron: split webhook delivery from announce mode * cron: validate webhook delivery target * cron: remove legacy webhook fallback config * fix: finalize cron webhook delivery prep (#17901) (thanks @advaitpaliwal) --------- Co-authored-by: Tyler Yust <TYTYYUST@YAHOO.COM>
This commit is contained in:
@@ -163,6 +163,25 @@ describe("normalizeCronJobCreate", () => {
|
||||
expect(delivery.to).toBe("7200373102");
|
||||
});
|
||||
|
||||
it("normalizes webhook delivery mode and target URL", () => {
|
||||
const normalized = normalizeCronJobCreate({
|
||||
name: "webhook delivery",
|
||||
enabled: true,
|
||||
schedule: { kind: "every", everyMs: 60_000 },
|
||||
sessionTarget: "main",
|
||||
wakeMode: "now",
|
||||
payload: { kind: "systemEvent", text: "hello" },
|
||||
delivery: {
|
||||
mode: " WeBhOoK ",
|
||||
to: " https://example.invalid/cron ",
|
||||
},
|
||||
}) as unknown as Record<string, unknown>;
|
||||
|
||||
const delivery = normalized.delivery as Record<string, unknown>;
|
||||
expect(delivery.mode).toBe("webhook");
|
||||
expect(delivery.to).toBe("https://example.invalid/cron");
|
||||
});
|
||||
|
||||
it("defaults isolated agentTurn delivery to announce", () => {
|
||||
const normalized = normalizeCronJobCreate({
|
||||
name: "default-announce",
|
||||
|
||||
Reference in New Issue
Block a user