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

Channel type `{channel_type}` does not support identity bind

Error message

Channel type `{channel_type}` does not support identity binding (supported: telegram, wechat, line).

What it means

Thrown by bind_channel_identity_into when channel_identity_normalizer(channel_type) returns None. Identity binding (pairing an operator's chat identity into a peer group allowlist) is only implemented for `telegram`, `wechat`, and `line`, because only those types have a normalization function; any other channel type hits the closed-set gate and the bind is rejected before touching config.

Source

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

///
/// Returns `Ok(true)` when the identity was newly added, `Ok(false)` when it
/// was already present. Pure config mutation — no disk write, no daemon
/// restart — so it is the single core shared by the CLI
/// (`bind_telegram_identity`) and the gateway bind endpoint. The `channel`
/// field is the dotted `<type>.<alias>` ref so authorization stays scoped to
/// the bound alias; a bare type would broaden the peer across every alias of
/// that type.
pub fn bind_channel_identity_into(
    config: &mut Config,
    channel_type: &str,
    alias: &str,
    identity: &str,
) -> Result<bool> {
    use zeroclaw_config::multi_agent::{PeerGroupConfig, PeerUsername};
    use zeroclaw_config::providers::ChannelRef;

    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>` \

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Use one of the supported types: telegram, wechat, or line
  2. For unsupported channels, authorize users through that channel's own mechanism (e.g. peer_groups config keyed by the channel's native identifiers) instead of the bind API
  3. Watch the supported set in channel_identity_normalizer — it only grows when a new pairing channel lands

Example fix

# before
zeroclaw bind discord default 123456789
# error: Channel type `discord` does not support identity binding (supported: telegram, wechat, line.)

# after — authorize discord users via peer_groups in zeroclaw.toml
[peer_groups.discord_default]
channel = "discord.default"
users = ["123456789"]
Defensive patterns

Strategy: type-guard

Validate before calling

use zeroclaw_channels::orchestrator::channel_identity_normalizer;
if channel_identity_normalizer(channel_type).is_none() {
    return Ok(notify(format!("{channel_type} has no identity binding; use telegram/wechat/line")));
}

Type guard

fn supports_identity_binding(channel_type: &str) -> bool {
    matches!(channel_type, "telegram" | "wechat" | "line")
}

Try / catch

Err(err) if err.to_string().contains("does not support identity binding") => {
    // route the user to the channel's native authorization mechanism instead
}

Prevention

When it happens

Trigger: Calling bind_channel_identity_into(config, "discord", alias, identity) — or via the CLI bind command / gateway bind endpoint with channel_type `discord`, `slack`, `matrix`, `signal`, etc. Anything outside {telegram, wechat, line} fails immediately.

Common situations: Assuming every configured channel supports operator identity binding; scripting a generic bind loop over all configured channel types; a new channel was added to config and the operator tries to bind to it before binding support landed.

Related errors


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