zeroclaw-labs/zeroclaw · error

WeCom WebSocket stream_mode={} is not supported; use partial

Error message

WeCom WebSocket stream_mode={} is not supported; use partial or off

What it means

The WeCom WebSocket channel constructor (new_with_alias) rejects StreamMode::MultiMessage because the WeCom WS protocol cannot support it; only Off and Partial are valid. Failing fast at construction prevents unsupported runtime behavior later.

Source

Thrown at crates/zeroclaw-channels/src/wecom_ws.rs:325

            config,
            "default",
            Self::static_policy_resolver(config),
            workspace_dir,
        )
    }

    pub(crate) fn new_with_alias(
        config: &WeComWsConfig,
        alias: impl Into<String>,
        policy_resolver: Arc<dyn Fn() -> WeComWsRuntimePolicy + Send + Sync>,
        workspace_dir: &Path,
    ) -> Result<Self> {
        let unsupported_stream_mode = match config.stream_mode {
            StreamMode::MultiMessage => Some("multi_message"),
            StreamMode::Off | StreamMode::Partial => None,
        };
        if let Some(mode) = unsupported_stream_mode {
            anyhow::bail!(
                "WeCom WebSocket stream_mode={} is not supported; use partial or off",
                mode
            );
        }

        let client = zeroclaw_config::schema::build_channel_proxy_client_with_timeouts(
            "channel.wecom_ws",
            config.proxy_url.as_deref(),
            WECOM_HTTP_TIMEOUT_SECS,
            WECOM_CONNECT_TIMEOUT_SECS,
        );

        Ok(Self {
            bot_id: config.bot_id.clone(),
            secret: config.secret.clone(),
            alias: alias.into(),
            policy_resolver,
            cfg: WeComRuntimeConfig {

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Set stream_mode = "off" or "partial" for the WeCom WebSocket channel
  2. If a global default is multi_message, add an explicit per-channel override for wecom_ws
  3. Keep stream_mode explicit per channel instead of relying on inherited defaults

Example fix

# before
[channels.wecom_ws]
stream_mode = "multi_message"
# after
[channels.wecom_ws]
stream_mode = "partial"
Defensive patterns

Strategy: validation

Validate before calling

fn wecom_stream_mode_ok(mode: &str) -> bool {
    matches!(mode, "off" | "partial")
}
if !wecom_stream_mode_ok(&cfg.stream_mode) {
    return Err(anyhow::anyhow!(
        "wecom_ws supports stream_mode off|partial, got {}",
        cfg.stream_mode
    ));
}

Try / catch

Let the constructor error propagate at load time — it is a fail-fast check; catch it during config validation and report the offending channel without starting the bot.

Prevention

When it happens

Trigger: Passing channel config with stream_mode = "multi_message" (a mode other channels accept) to the wecom_ws channel constructor.

Common situations: Copying a channel config block from another channel type that supports multi-message streaming; a global stream_mode default of multi_message inherited by the WeCom channel.

Related errors


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