{"record":{"id":"f88235b524c0017e","repo":"zeroclaw-labs/zeroclaw","slug":"discord-channel-requires-the-channel-discord-fea","errorCode":null,"errorMessage":"Discord channel requires the `channel-discord` feature","messagePattern":"Discord channel requires the `channel-discord` feature","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-channels/src/orchestrator/mod.rs","lineNumber":8977,"sourceCode":"                    dc.mention_only,\n                )\n                .with_channel_ids(dc.channel_ids.clone())\n                .with_workspace_dir(workspace_dir)\n                .with_streaming(\n                    dc.stream_mode,\n                    dc.draft_update_interval_ms,\n                    dc.multi_message_delay_ms,\n                )\n                .with_transcription(config.transcription.clone())\n                .with_stall_timeout(dc.stall_timeout_secs)\n                .with_approval_timeout_secs(dc.approval_timeout_secs)\n                .with_intents_mask(dc.intents_mask)\n                .with_reaction_notifications(dc.reaction_notifications),\n            ))\n        }\n        #[cfg(not(feature = \"channel-discord\"))]\n        \"discord\" => {\n            anyhow::bail!(\"Discord channel requires the `channel-discord` feature\");\n        }\n        #[cfg(feature = \"channel-slack\")]\n        \"slack\" => {\n            let sl = config\n                .channels\n                .slack\n                .get(\"default\")\n                .context(\"Slack 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(\"slack\", &alias))\n            };\n            let thread_context_max_messages_resolver =\n                slack_thread_context_max_messages_resolver(config_arc, &alias);\n            let workspace_dir = one_shot_channel_workspace_dir(&config, \"slack\", &alias);\n            let bot_token = sl.resolved_bot_token().with_context(|| {","sourceCodeStart":8959,"sourceCodeEnd":8995,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-channels/src/orchestrator/mod.rs#L8959-L8995","documentation":"Thrown by build_channel_by_id when channel_type is `discord` and the crate lacks the `channel-discord` cargo feature. The discord match arm only exists under that feature; without it, the fallback arm bails because the Discord runtime code was compiled out. Identical in shape to the other channel feature gates (telegram, slack, mattermost, signal, matrix, whatsapp-web).","triggerScenarios":"A `[channels.discord.*]` alias is configured, or a one-shot send targets `discord.<alias>`, while the binary was compiled without `channel-discord`. Occurs at daemon channel construction and at build_channel_by_id for ad-hoc sends.","commonSituations":"Minimal docker/distro build with only some channels enabled; `--no-default-features` local build; config written on a full build then deployed to a slim build.","solutions":["Rebuild including the feature: `cargo build --features channel-discord`","Use a distribution image that ships the discord feature","Or drop `[channels.discord]` from config so the channel is never constructed"],"exampleFix":"# before\ncargo build --no-default-features --features channel-telegram\n# error: Discord channel requires the `channel-discord` feature\n\n# after\ncargo build --no-default-features --features \"channel-telegram,channel-discord\"","handlingStrategy":"validation","validationCode":"#[cfg(not(feature = \"channel-discord\"))]\nif !config.channels.discord.is_empty() {\n    log::warn!(\"[channels.discord.*] configured but `channel-discord` feature is off\");\n}","typeGuard":"fn channel_feature_enabled(channel_type: &str) -> bool {\n    match channel_type {\n        \"discord\" => cfg!(feature = \"channel-discord\"),\n        \"telegram\" => cfg!(feature = \"channel-telegram\"),\n        \"slack\" => cfg!(feature = \"channel-slack\"),\n        \"mattermost\" => cfg!(feature = \"channel-mattermost\"),\n        \"signal\" => cfg!(feature = \"channel-signal\"),\n        \"matrix\" => cfg!(feature = \"channel-matrix\"),\n        \"whatsapp\" | \"whatsapp-web\" => cfg!(feature = \"whatsapp-web\"),\n        _ => false,\n    }\n}","tryCatchPattern":"Err(err) if err.to_string().contains(\"requires the `channel-discord` feature\") => {\n    // surface: rebuild with --features channel-discord or remove the discord config\n}","preventionTips":["Enable every channel feature you configure, or strip config sections for disabled channels","Pin feature sets in CI builds and diff them against config on deploy","Prefer full-featured builds for developer machines to decouple config from build flags"],"tags":["feature-flag","discord","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"}