Skip to content

Commit d7d3416

Browse files
author
lailoo
authored
fix(cron): disable messaging tool when delivery.mode is none (#21808) (#21896)
1 parent e1df1c6 commit d7d3416

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Docs: https://docs.openclaw.ai
1919

2020
### Fixes
2121

22+
- Cron/Delivery: disable the agent messaging tool when `delivery.mode` is `"none"` so cron output is not sent to Telegram or other channels. (#21808)
2223
- Feishu/Reply media attachments: send Feishu reply `mediaUrl`/`mediaUrls` payloads as attachments alongside text/streamed replies in the reply dispatcher, including legacy fallback when `mediaUrls` is empty. (#28959)
2324
- Feishu/Reaction notifications: add `channels.feishu.reactionNotifications` (`off | own | all`, default `own`) so operators can disable reaction ingress or allow all verified reaction events (not only bot-authored message reactions). (#28529)
2425
- Feishu/Outbound session routing: stop assuming bare `oc_` identifiers are always group chats, honor explicit `dm:`/`group:` prefixes for `oc_` chat IDs, and default ambiguous bare `oc_` targets to direct routing to avoid DM session misclassification. (#10407) Thanks @Bermudarat.

src/cron/delivery.test.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,16 @@ describe("resolveCronDeliveryPlan", () => {
4343
expect(plan.requested).toBe(false);
4444
});
4545

46-
it("passes through accountId from delivery config", () => {
46+
it("resolves mode=none with requested=false and no channel (#21808)", () => {
4747
const plan = resolveCronDeliveryPlan(
4848
makeJob({
49-
delivery: {
50-
mode: "announce",
51-
channel: "telegram",
52-
to: "-1003816714067",
53-
accountId: "coordinator",
54-
},
55-
}),
56-
);
57-
expect(plan.mode).toBe("announce");
58-
expect(plan.accountId).toBe("coordinator");
59-
expect(plan.to).toBe("-1003816714067");
60-
});
61-
62-
it("returns undefined accountId when not set", () => {
63-
const plan = resolveCronDeliveryPlan(
64-
makeJob({
65-
delivery: { mode: "announce", channel: "telegram", to: "123" },
49+
delivery: { mode: "none", to: "telegram:123" },
6650
}),
6751
);
68-
expect(plan.accountId).toBeUndefined();
52+
expect(plan.mode).toBe("none");
53+
expect(plan.requested).toBe(false);
54+
expect(plan.channel).toBeUndefined();
55+
expect(plan.to).toBe("telegram:123");
6956
});
7057

7158
it("resolves webhook mode without channel routing", () => {

src/cron/isolated-agent/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ export async function runCronIsolatedAgentTurn(params: {
470470
// was successfully resolved. When resolution fails the agent should not
471471
// be blocked by a target it cannot satisfy (#27898).
472472
requireExplicitMessageTarget: deliveryRequested && resolvedDelivery.ok,
473-
disableMessageTool: deliveryRequested,
473+
disableMessageTool: deliveryRequested || deliveryPlan.mode === "none",
474474
abortSignal,
475475
});
476476
},

0 commit comments

Comments
 (0)