zeroclaw-labs/zeroclaw · error · anyhow::Error

channel alias ` ` is not configured. Run `zeroclaw config…

Error message

{channel_type} channel alias `{alias}` is not configured. Run `zeroclaw config set channels.{channel_type}.{alias}.bot_token <token>` (see docs/book/src/channels/overview.md for the full field list).

What it means

Thrown by bind_channel_identity_into when channel_alias_configured() reports that no `[channels.<type>.<alias>]` section exists. Binding into a phantom alias would create a peer group scoped to `<type>.<alias>` that the running channel never reads (authorization resolves under the alias the channel actually runs as), so the code fails loudly instead of silently authorizing nobody.

Solutions

  1. List configured aliases of that type in zeroclaw.toml under `[channels.telegram]` (or wechat/line) and re-run the bind with the exact alias
  2. If the alias should exist, create it: `zeroclaw config set channels.telegram.work.bot_token <token>` (plus the other required fields per docs/book/src/channels/overview.md)
  3. Re-run the bind command with the corrected alias

Example fix

# before
zeroclaw bind telegram work 123456789
# error: telegram channel alias `work` is not configured.

# after
zeroclaw config set channels.telegram.work.bot_token "123:ABC"
zeroclaw bind telegram work 123456789
Defensive patterns

Strategy: validation

Validate before calling

use zeroclaw_channels::orchestrator::channel_alias_configured;
if !channel_alias_configured(&config, channel_type, alias) {
    return Ok(notify(format!("configure [channels.{channel_type}.{alias}] first")));
}
bind_channel_identity_into(&mut config, channel_type, alias, identity)?;

Try / catch

Err(err) if err.to_string().contains("is not configured") => {
    // offer to create the channel section or list existing aliases of that type
}

Prevention

When it happens

Trigger: Calling bind_channel_identity_into(config, "telegram", "work", ...) when `[channels.telegram.work]` is absent — e.g. the channel was configured under alias `default`, or the section was removed. Alias matching is exact against the typed channel maps (config.channels.telegram/wechat/line).

Common situations: Binding to the wrong alias name (typo, or assuming `default` when the config uses `work`); channel section deleted after the bind command was drafted; forgetting to run `zeroclaw setup telegram` first so no channel section exists yet.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/87fcc75c2193c399. Report an issue: GitHub.

Appendix: source

Thrown at crates/zeroclaw-channels/src/orchestrator/mod.rs:8674

    let Some(normalize) = channel_identity_normalizer(channel_type) else {
        anyhow::bail!(
            "Channel type `{channel_type}` does not support identity binding \
             (supported: telegram, wechat, line)."
        );
    };

    let normalized = normalize(identity);
    if normalized.is_empty() {
        anyhow::bail!("{channel_type} identity cannot be empty");
    }

    // The alias must name an existing `[channels.<type>.<alias>]` section.
    // Binding into a phantom alias would mint a peer group the runtime never
    // reads (it resolves authorization per the alias the channel actually
    // runs under), so fail loudly instead of silently authorizing nobody.
    if !channel_alias_configured(config, channel_type, alias) {
        anyhow::bail!(
            "{channel_type} channel alias `{alias}` is not configured. Run \
             `zeroclaw config set channels.{channel_type}.{alias}.bot_token <token>` \
             (see docs/book/src/channels/overview.md for the full field list)."
        );
    }

    let group_name = format!("{channel_type}_{alias}");
    let channel_ref = format!("{channel_type}.{alias}");
    let group = config
        .peer_groups
        .entry(group_name)
        .or_insert_with(|| PeerGroupConfig {
            channel: ChannelRef::new(channel_ref),
            ..PeerGroupConfig::default()
        });

    if group
        .external_peers

View on GitHub (pinned to 88bb9c8533)