{"record":{"id":"0c00dc7a256646ce","repo":"zeroclaw-labs/zeroclaw","slug":"matrix-channel-requires-the-channel-matrix-featu","errorCode":null,"errorMessage":"Matrix channel requires the `channel-matrix` feature","messagePattern":"Matrix channel requires the `channel-matrix` feature","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-channels/src/orchestrator/mod.rs","lineNumber":9114,"sourceCode":"                let alias = \"default\".to_string();\n                let state_dir = matrix_state_dir(&config.config_path, &alias);\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(\"matrix\", &alias))\n                };\n                let ack = mx.ack_reactions.unwrap_or(config.channels.ack_reactions);\n                let workspace_dir = one_shot_channel_workspace_dir(&config, \"matrix\", &alias);\n                Ok(Arc::new(\n                    MatrixChannel::new(mx.clone(), alias, peer_resolver, state_dir)?\n                        .with_transcription(config.transcription.clone())\n                        .with_workspace_dir(workspace_dir)\n                        .with_ack_reactions(ack),\n                ))\n            }\n            #[cfg(not(feature = \"channel-matrix\"))]\n            {\n                anyhow::bail!(\"Matrix channel requires the `channel-matrix` feature\");\n            }\n        }\n        \"whatsapp\" | \"whatsapp-web\" | \"whatsapp_web\" => {\n            #[cfg(feature = \"whatsapp-web\")]\n            {\n                let wa = config\n                    .channels\n                    .whatsapp\n                    .get(\"default\")\n                    .context(\"WhatsApp channel is not configured\")?;\n                if !wa.is_web_config() {\n                    anyhow::bail!(\n                        \"WhatsApp channel send requires Web mode (set session_path, pair_phone, or mode = personal)\"\n                    );\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();","sourceCodeStart":9096,"sourceCodeEnd":9132,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-channels/src/orchestrator/mod.rs#L9096-L9132","documentation":"Thrown by build_channel_by_id when channel_type is `matrix` and the crate was compiled without the `channel-matrix` cargo feature. Matrix uses a block-form match arm (feature on the inner block, bail in the cfg(not) block) rather than a separate arm, but the semantics match the other channel gates: the Matrix runtime code is not in the binary, so the channel cannot be built.","triggerScenarios":"A `[channels.matrix.*]` section or `matrix.<alias>` send target on a binary lacking `channel-matrix`; hit at daemon channel construction and in the one-shot delivery path.","commonSituations":"Minimal builds; feature sets changed across versions; config migrated from a matrix-enabled deployment to one that is not.","solutions":["Rebuild with `cargo build --features channel-matrix`","Choose a distribution build that enables matrix","Or strip `[channels.matrix]` from config so the channel is never instantiated"],"exampleFix":"# before\ncargo build --no-default-features\n# error: Matrix channel requires the `channel-matrix` feature\n\n# after\ncargo build --no-default-features --features channel-matrix","handlingStrategy":"validation","validationCode":"#[cfg(not(feature = \"channel-matrix\"))]\nif !config.channels.matrix.is_empty() {\n    log::warn!(\"[channels.matrix.*] configured but `channel-matrix` feature is off\");\n}","typeGuard":"fn channel_feature_enabled(channel_type: &str) -> bool {\n    match channel_type {\n        \"matrix\" => cfg!(feature = \"channel-matrix\"),\n        \"telegram\" => cfg!(feature = \"channel-telegram\"),\n        \"discord\" => cfg!(feature = \"channel-discord\"),\n        \"slack\" => cfg!(feature = \"channel-slack\"),\n        \"mattermost\" => cfg!(feature = \"channel-mattermost\"),\n        \"signal\" => cfg!(feature = \"channel-signal\"),\n        \"whatsapp\" | \"whatsapp-web\" => cfg!(feature = \"whatsapp-web\"),\n        _ => false,\n    }\n}","tryCatchPattern":"Err(err) if err.to_string().contains(\"requires the `channel-matrix` feature\") => {\n    // rebuild with --features channel-matrix or remove matrix sections\n}","preventionTips":["Add a startup assertion that every configured channel type has its feature compiled","Keep a build matrix in CI covering the feature combinations you actually ship","Document the full channel->feature mapping in one table"],"tags":["feature-flag","matrix","build-configuration","zeroclaw"],"backgroundTag":"missing-compile-time-feature","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}