Skip to content

Commit bb134fe

Browse files
fix(cli): clarify cron channel plugin ids (#124655)
Keep cron delivery help and automation docs explicit that --channel selects a channel plugin, not a per-conversation channel identifier. Fixes #124646 Punchcard-Session: clear-timber-orchard-n1
1 parent 607eb2e commit bb134fe

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎docs/automation/cron-jobs.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ services. Leaving the policy unset keeps strict behavior.
367367

368368
Use `--announce --channel telegram --to "-1001234567890"` for channel delivery. For Telegram forum topics, use `-1001234567890:topic:123`; OpenClaw also accepts the Telegram-owned `-1001234567890:123` shorthand. Direct RPC/config callers may pass `delivery.threadId` as a string or number. Slack/Discord/Mattermost targets use explicit prefixes (`channel:<id>`, `user:<id>`). Matrix room IDs are case-sensitive; use the exact room ID or `room:!room:server` form from Matrix.
369369

370-
On hosts with multiple configured channels, isolated announce jobs created with `automations add|create` or changed with `automations edit` must set `--channel <id>` unless a provider-prefixed `--to` or a preserved session route selects the channel. Use `--best-effort-deliver` only when unresolved fallback delivery is acceptable; it does not choose a channel, and a delivery failure does not fail the job.
370+
On hosts with multiple configured channels, isolated announce jobs created with `automations add|create` or changed with `automations edit` must set `--channel <channel-plugin-id>` unless a provider-prefixed `--to` or a preserved session route selects the channel. Use `--best-effort-deliver` only when unresolved fallback delivery is acceptable; it does not choose a channel, and a delivery failure does not fail the job.
371371

372372
When announce delivery uses `channel: "last"` or omits `channel`, a provider-prefixed target such as `telegram:123` can select the channel before the scheduler falls back to session history or a single configured channel. Only prefixes advertised by the loaded plugin are provider selectors. If `delivery.channel` is explicit, the target prefix must name the same provider; `channel: "whatsapp"` with `to: "telegram:123"` is rejected instead of letting WhatsApp interpret the Telegram ID as a phone number. Target-kind and service prefixes (`channel:<id>`, `user:<id>`, `imessage:<handle>`, `sms:<number>`) stay channel-owned target syntax, not provider selectors.
373373

‎src/cli/cron-cli/shared.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,9 +675,9 @@ describe("parseAt", () => {
675675
});
676676

677677
describe("getCronChannelOptions", () => {
678-
it("falls back to a generic channel placeholder when no plugins are loaded", () => {
678+
it("falls back to a channel plugin id placeholder when no plugins are loaded", () => {
679679
hoisted.listChannelPluginsMock.mockReturnValue([]);
680-
expect(getCronChannelOptions()).toBe("last|<channel-id>");
680+
expect(getCronChannelOptions()).toBe("last|<channel-plugin-id>");
681681
});
682682

683683
it("lists discovered channel plugin ids when plugins are available", () => {

‎src/cli/cron-cli/shared.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ export function parseCronCommandEnv(values: unknown): Record<string, string> | u
7878
}
7979

8080
export const getCronChannelOptions = () => {
81-
// Keep help truthful even before the plugin registry is bootstrapped.
81+
// Keep help truthful even before the plugin registry is bootstrapped. The fallback names the
82+
// channel plugin id the runtime resolves, not a per-conversation platform channel identifier.
8283
const pluginIds = listChannelPlugins()
8384
.map((plugin) => plugin.id)
8485
.filter(Boolean);
85-
return pluginIds.length > 0 ? ["last", ...pluginIds].join("|") : "last|<channel-id>";
86+
return pluginIds.length > 0 ? ["last", ...pluginIds].join("|") : "last|<channel-plugin-id>";
8687
};
8788

8889
function toLocalIsoTime(value: unknown): string | undefined {

0 commit comments

Comments
 (0)