mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 18:50:21 +00:00
feat(cron): introduce delivery modes for isolated jobs
- Added support for new delivery modes in cron jobs: `announce`, `deliver`, and `none`. - Updated documentation to reflect changes in delivery options and usage examples. - Enhanced the cron job schema to include delivery configuration. - Refactored related CLI commands and UI components to accommodate the new delivery settings. - Improved handling of legacy delivery fields for backward compatibility. This update allows users to choose how output from isolated jobs is delivered, enhancing flexibility in job management.
This commit is contained in:
committed by
Peter Steinberger
parent
3a03e38378
commit
511c656cbc
@@ -110,4 +110,28 @@ describe("normalizeCronJobCreate", () => {
|
||||
expect(schedule.kind).toBe("at");
|
||||
expect(schedule.atMs).toBe(Date.parse("2026-01-12T18:00:00Z"));
|
||||
});
|
||||
|
||||
it("normalizes delivery mode and channel", () => {
|
||||
const normalized = normalizeCronJobCreate({
|
||||
name: "delivery",
|
||||
enabled: true,
|
||||
schedule: { kind: "cron", expr: "* * * * *" },
|
||||
sessionTarget: "isolated",
|
||||
wakeMode: "now",
|
||||
payload: {
|
||||
kind: "agentTurn",
|
||||
message: "hi",
|
||||
},
|
||||
delivery: {
|
||||
mode: " ANNOUNCE ",
|
||||
channel: " TeLeGrAm ",
|
||||
to: " 7200373102 ",
|
||||
},
|
||||
}) as unknown as Record<string, unknown>;
|
||||
|
||||
const delivery = normalized.delivery as Record<string, unknown>;
|
||||
expect(delivery.mode).toBe("announce");
|
||||
expect(delivery.channel).toBe("telegram");
|
||||
expect(delivery.to).toBe("7200373102");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user