fix(cron): disable messaging tool when delivery.mode is none (#21808) (#21896)

This commit is contained in:
lailoo 2026-03-01 01:12:17 +08:00 committed by GitHub
parent e1df1c60b8
commit d7d3416b1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 20 deletions

View File

@ -19,6 +19,7 @@ Docs: https://docs.openclaw.ai
### Fixes
- Cron/Delivery: disable the agent messaging tool when `delivery.mode` is `"none"` so cron output is not sent to Telegram or other channels. (#21808)
- 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)
- 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)
- 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.

View File

@ -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", () => {

View File

@ -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,
});
},