mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 12:20:35 +00:00
feat(cron): add --account flag for multi-account delivery routing (#26284)
* feat(cron): add --account flag for multi-account delivery routing Add support for explicit delivery account routing in cron jobs across CLI, normalization, delivery planning, and isolated delivery target resolution. Highlights: - Add --account <id> to cron add and cron edit - Add optional delivery.accountId to cron types and delivery plan - Normalize and trim delivery.accountId in cron create/update normalization - Prefer explicit accountId over session lastAccountId and bindings fallback - Thread accountId through isolated cron run delivery resolution - Preserve cron edit --best-effort-deliver/--no-best-effort-deliver behavior by keeping implicit announce mode - Expand tests for account passthrough/merge/precedence and CLI account flows * cron: resolve rebase duplicate accountId fields --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -43,6 +43,31 @@ describe("resolveCronDeliveryPlan", () => {
|
||||
expect(plan.requested).toBe(false);
|
||||
});
|
||||
|
||||
it("passes through accountId from delivery config", () => {
|
||||
const plan = resolveCronDeliveryPlan(
|
||||
makeJob({
|
||||
delivery: {
|
||||
mode: "announce",
|
||||
channel: "telegram",
|
||||
to: "-1003816714067",
|
||||
accountId: "coordinator",
|
||||
},
|
||||
}),
|
||||
);
|
||||
expect(plan.mode).toBe("announce");
|
||||
expect(plan.accountId).toBe("coordinator");
|
||||
expect(plan.to).toBe("-1003816714067");
|
||||
});
|
||||
|
||||
it("returns undefined accountId when not set", () => {
|
||||
const plan = resolveCronDeliveryPlan(
|
||||
makeJob({
|
||||
delivery: { mode: "announce", channel: "telegram", to: "123" },
|
||||
}),
|
||||
);
|
||||
expect(plan.accountId).toBeUndefined();
|
||||
});
|
||||
|
||||
it("resolves webhook mode without channel routing", () => {
|
||||
const plan = resolveCronDeliveryPlan(
|
||||
makeJob({
|
||||
|
||||
Reference in New Issue
Block a user