{"record":{"id":"c4b22a25238ea9a3","repo":"zeroclaw-labs/zeroclaw","slug":"mochat-channel-requires-the-channel-mochat-featu","errorCode":null,"errorMessage":"Mochat channel requires the `channel-mochat` feature","messagePattern":"Mochat channel requires the `channel-mochat` feature","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-channels/src/orchestrator/mod.rs","lineNumber":9602,"sourceCode":"                .get(\"default\")\n                .context(\"Mochat channel is not configured\")?;\n            let alias = \"default\".to_string();\n            let peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync> = {\n                let cfg_arc = config_arc.clone();\n                let alias = alias.clone();\n                Arc::new(move || cfg_arc.read().channel_external_peers(\"mochat\", &alias))\n            };\n            Ok(Arc::new(MochatChannel::new(\n                mc.api_url.clone(),\n                mc.api_token.clone(),\n                alias,\n                peer_resolver,\n                mc.poll_interval_secs,\n            )))\n        }\n        #[cfg(not(feature = \"channel-mochat\"))]\n        \"mochat\" => {\n            anyhow::bail!(\"Mochat channel requires the `channel-mochat` feature\");\n        }\n        #[cfg(feature = \"channel-imessage\")]\n        \"imessage\" => {\n            if !config.channels.imessage.contains_key(\"default\") {\n                anyhow::bail!(\"iMessage channel is not configured\");\n            }\n            let alias = \"default\".to_string();\n            let peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync> = {\n                let cfg_arc = config_arc.clone();\n                let alias = alias.clone();\n                Arc::new(move || cfg_arc.read().channel_external_peers(\"imessage\", &alias))\n            };\n            Ok(Arc::new(IMessageChannel::new(alias, peer_resolver)))\n        }\n        #[cfg(not(feature = \"channel-imessage\"))]\n        \"imessage\" => {\n            anyhow::bail!(\"iMessage channel requires the `channel-imessage` feature\");\n        }","sourceCodeStart":9584,"sourceCodeEnd":9620,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-channels/src/orchestrator/mod.rs#L9584-L9620","documentation":"Raised by build_channel_by_id when channel_id = \"mochat\" is requested but the binary was compiled without the `channel-mochat` feature. The enabled arm builds the Mochat channel with peer_resolver and a poll_interval_secs from [channels.mochat]; without the feature only the bail arm exists.","triggerScenarios":"start_channels / build_channel_by_id selecting \"mochat\" from an [channels.mochat] block or agent binding in a build lacking --features channel-mochat.","commonSituations":"Default-feature builds (mochat is in channels-full only); WeChat-adjacent stacks where Mochat was configured but the binary was compiled from a curated feature list; configs synced between full and slim deployments.","solutions":["Rebuild with cargo build --release --features channel-mochat","Or use --features channels-full","Or remove [channels.mochat] and \"mochat\" bindings","Check zeroclaw_channels::listing::is_channel_type_compiled(\"mochat\")"],"exampleFix":"# before\n cargo build --release\n\n # after\n cargo build --release --features channel-mochat","handlingStrategy":"validation","validationCode":"use zeroclaw_channels::listing::is_channel_type_compiled;\n\nif !is_channel_type_compiled(\"mochat\") {\n    eprintln!(\"rebuild with --features channel-mochat or remove [channels.mochat]\");\n}","typeGuard":"fn mochat_available() -> bool {\n    zeroclaw_channels::listing::is_channel_type_compiled(\"mochat\")\n}","tryCatchPattern":"match build_channel_by_id(&config_arc, \"mochat\") {\n    Ok(ch) => { /* use */ }\n    Err(e) if e.to_string().contains(\"requires the `channel-mochat` feature\") => {\n        // skip; rebuild hint\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Mochat is cfg-gated only; adding it to a build is zero-dep cost, so consider channels-full for WeChat-adjacent stacks","Lint config channel ids against the compiled listing on deploy"],"tags":["rust","cargo-features","feature-gate","zeroclaw","channels","mochat"],"backgroundTag":"cargo-feature-not-enabled","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}