Summary
Running clawdbot message send --channel telegram ... fails with Error: Unknown channel: telegram even though Telegram is configured and running.
This appears to happen because the Commander (non-route-first) code path does not load the plugin registry before resolving channel plugins, so getChannelPlugin('telegram') returns undefined.
Version
- Clawdbot: 2026.1.17-1 (39dfdcc)
- macOS: Darwin 25.2.0 (arm64)
Steps to reproduce
- Configure Telegram (works for inbound/outbound via normal agent replies).
- Run:
clawdbot message send --channel telegram --target "-100..." --message "test" --dry-run --json
Actual behavior
Command exits with:
Error: Unknown channel: telegram
Expected behavior
CLI should resolve the Telegram channel plugin and proceed (or at least produce a target-format error, not an unknown channel error).
Diagnosis
- The fast CLI routing path (
tryRouteCli) calls ensurePluginRegistryLoaded() when needed.
clawdbot message ... is handled via the Commander path (registerMessageCommands).
- In the Commander path,
preAction calls ensureConfigReady() but does not load the plugin registry, so channel plugins are not available.
This likely regressed around PR #1195 (CLI speedups / routing + config guards), which refactored src/cli/program/preaction.ts.
Workaround / Proposed fix
Load the plugin registry in preAction for commands that rely on plugins (e.g. message, channels, etc.), skipping only commands like setup/onboard/configure/config/reset/uninstall where plugin loading is unnecessary.
Example patch (conceptual):
import { ensurePluginRegistryLoaded } from "../plugin-registry.js";
...
await ensureConfigReady(...);
if (!skipPlugins.has(rootCommand)) ensurePluginRegistryLoaded();
Happy to submit a PR if you'd like.
Summary
Running
clawdbot message send --channel telegram ...fails withError: Unknown channel: telegrameven though Telegram is configured and running.This appears to happen because the Commander (non-route-first) code path does not load the plugin registry before resolving channel plugins, so
getChannelPlugin('telegram')returns undefined.Version
Steps to reproduce
Actual behavior
Command exits with:
Expected behavior
CLI should resolve the Telegram channel plugin and proceed (or at least produce a target-format error, not an unknown channel error).
Diagnosis
tryRouteCli) callsensurePluginRegistryLoaded()when needed.clawdbot message ...is handled via the Commander path (registerMessageCommands).preActioncallsensureConfigReady()but does not load the plugin registry, so channel plugins are not available.This likely regressed around PR #1195 (CLI speedups / routing + config guards), which refactored
src/cli/program/preaction.ts.Workaround / Proposed fix
Load the plugin registry in
preActionfor commands that rely on plugins (e.g.message,channels, etc.), skipping only commands likesetup/onboard/configure/config/reset/uninstallwhere plugin loading is unnecessary.Example patch (conceptual):
Happy to submit a PR if you'd like.