mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 10:01:11 +00:00
This commit is contained in:
@@ -43,29 +43,16 @@ describe("resolveCronDeliveryPlan", () => {
|
||||
expect(plan.requested).toBe(false);
|
||||
});
|
||||
|
||||
it("passes through accountId from delivery config", () => {
|
||||
it("resolves mode=none with requested=false and no channel (#21808)", () => {
|
||||
const plan = resolveCronDeliveryPlan(
|
||||
makeJob({
|
||||
delivery: {
|
||||
mode: "announce",
|
||||
channel: "telegram",
|
||||
to: "-1003816714067",
|
||||
accountId: "coordinator",
|
||||
},
|
||||
delivery: { mode: "none", to: "telegram:123" },
|
||||
}),
|
||||
);
|
||||
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();
|
||||
expect(plan.mode).toBe("none");
|
||||
expect(plan.requested).toBe(false);
|
||||
expect(plan.channel).toBeUndefined();
|
||||
expect(plan.to).toBe("telegram:123");
|
||||
});
|
||||
|
||||
it("resolves webhook mode without channel routing", () => {
|
||||
|
||||
@@ -470,7 +470,7 @@ export async function runCronIsolatedAgentTurn(params: {
|
||||
// was successfully resolved. When resolution fails the agent should not
|
||||
// be blocked by a target it cannot satisfy (#27898).
|
||||
requireExplicitMessageTarget: deliveryRequested && resolvedDelivery.ok,
|
||||
disableMessageTool: deliveryRequested,
|
||||
disableMessageTool: deliveryRequested || deliveryPlan.mode === "none",
|
||||
abortSignal,
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user