{"record":{"id":"fd31e03478a42b98","repo":"zeroclaw-labs/zeroclaw","slug":"wecom-websocket-stream-mode-is-not-supported-u","errorCode":null,"errorMessage":"WeCom WebSocket stream_mode={} is not supported; use partial or off","messagePattern":"WeCom WebSocket stream_mode=(.+?) is not supported; use partial or off","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-channels/src/wecom_ws.rs","lineNumber":325,"sourceCode":"            config,\n            \"default\",\n            Self::static_policy_resolver(config),\n            workspace_dir,\n        )\n    }\n\n    pub(crate) fn new_with_alias(\n        config: &WeComWsConfig,\n        alias: impl Into<String>,\n        policy_resolver: Arc<dyn Fn() -> WeComWsRuntimePolicy + Send + Sync>,\n        workspace_dir: &Path,\n    ) -> Result<Self> {\n        let unsupported_stream_mode = match config.stream_mode {\n            StreamMode::MultiMessage => Some(\"multi_message\"),\n            StreamMode::Off | StreamMode::Partial => None,\n        };\n        if let Some(mode) = unsupported_stream_mode {\n            anyhow::bail!(\n                \"WeCom WebSocket stream_mode={} is not supported; use partial or off\",\n                mode\n            );\n        }\n\n        let client = zeroclaw_config::schema::build_channel_proxy_client_with_timeouts(\n            \"channel.wecom_ws\",\n            config.proxy_url.as_deref(),\n            WECOM_HTTP_TIMEOUT_SECS,\n            WECOM_CONNECT_TIMEOUT_SECS,\n        );\n\n        Ok(Self {\n            bot_id: config.bot_id.clone(),\n            secret: config.secret.clone(),\n            alias: alias.into(),\n            policy_resolver,\n            cfg: WeComRuntimeConfig {","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-channels/src/wecom_ws.rs#L307-L343","documentation":"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.","triggerScenarios":"Passing channel config with stream_mode = \"multi_message\" (a mode other channels accept) to the wecom_ws channel constructor.","commonSituations":"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.","solutions":["Set stream_mode = \"off\" or \"partial\" for the WeCom WebSocket channel","If a global default is multi_message, add an explicit per-channel override for wecom_ws","Keep stream_mode explicit per channel instead of relying on inherited defaults"],"exampleFix":"# before\n[channels.wecom_ws]\nstream_mode = \"multi_message\"\n# after\n[channels.wecom_ws]\nstream_mode = \"partial\"","handlingStrategy":"validation","validationCode":"fn wecom_stream_mode_ok(mode: &str) -> bool {\n    matches!(mode, \"off\" | \"partial\")\n}\nif !wecom_stream_mode_ok(&cfg.stream_mode) {\n    return Err(anyhow::anyhow!(\n        \"wecom_ws supports stream_mode off|partial, got {}\",\n        cfg.stream_mode\n    ));\n}","typeGuard":null,"tryCatchPattern":"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.","preventionTips":["Encode per-channel enum restrictions in the config schema so invalid modes are rejected at load","Keep stream_mode explicit per channel instead of inheriting a global default","Add a config-lint step in CI for copied channel blocks"],"tags":["wecom","websocket","stream-mode","config","constructor"],"backgroundTag":"unsupported-config-value","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}