{"record":{"id":"b7f8145fc0b796cb","repo":"zeroclaw-labs/zeroclaw","slug":"imessage-channel-is-not-configured","errorCode":null,"errorMessage":"iMessage channel is not configured","messagePattern":"iMessage channel is not configured","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-channels/src/orchestrator/mod.rs","lineNumber":9607,"sourceCode":"                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        }\n        \"line\" => {\n            #[cfg(feature = \"channel-line\")]\n            {\n                let ln = config\n                    .channels","sourceCodeStart":9589,"sourceCodeEnd":9625,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-channels/src/orchestrator/mod.rs#L9589-L9625","documentation":"Raised by build_channel_by_id in the feature-ENABLED iMessage arm: the channel is compiled in, but config.channels.imessage (a map of instances keyed by alias) contains no \"default\" key. Unlike the feature-gate bails, this is a pure configuration error — the code hardcodes alias \"default\" and requires [channels.imessage.default] to exist before constructing IMessageChannel. Any other alias key alone does not satisfy the check.","triggerScenarios":"start_channels / build_channel_by_id with channel_id = \"imessage\", the channel-imessage feature compiled in, and [channels.imessage] absent, empty, or containing only non-\"default\" aliases (e.g. just [channels.imessage.phone]).","commonSituations":"Configuring iMessage for the first time and omitting the section; renaming the instance alias away from \"default\"; config generation tools that emit [channels.imessage] without a nested instance table; toggling imessage on in an agent binding without ever adding the channel block.","solutions":["Add a [channels.imessage.default] section to the ZeroClaw config (the factory only reads the \"default\" key)","If you renamed the instance, either restore the key name to \"default\" or move the settings back under it","Reload/restart the daemon so the config is re-read, then confirm the error is gone","If the build lacks channel-imessage you will instead see error \"iMessage channel requires the `channel-imessage` feature\" — rebuild with that feature first"],"exampleFix":"# before\n # config.toml\n [channels.imessage]        # empty map -> contains_key(\"default\") is false\n\n # after\n [channels.imessage.default]\n enabled = true","handlingStrategy":"validation","validationCode":"// gate on the exact condition the factory checks\nlet has_default = config\n    .channels\n    .imessage\n    .as_ref()\n    .map(|m| m.contains_key(\"default\"))\n    .unwrap_or(false);\nif bindings.contains(&\"imessage\") && !has_default {\n    eprintln!(\"add [channels.imessage.default] to the config before starting channels\");\n}","typeGuard":"fn imessage_configured(cfg: &zeroclaw_config::schema::Config) -> bool {\n    cfg.channels\n        .imessage\n        .as_ref()\n        .map(|m| m.contains_key(\"default\"))\n        .unwrap_or(false)\n}","tryCatchPattern":"match build_channel_by_id(&config_arc, \"imessage\") {\n    Ok(ch) => { /* use */ }\n    Err(e) if e.to_string() == \"iMessage channel is not configured\" => {\n        // config fix, not a rebuild: create [channels.imessage.default] then reload\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["The factory only reads the \"default\" alias — do not rename the iMessage instance key","Distinguish this config error from the feature-gate bail: \"not configured\" means compiled in but missing the section","Run a config-lint step that asserts every bound channel id has its config section before daemon start"],"tags":["zeroclaw","configuration","channels","imessage","config-missing-section"],"backgroundTag":"channel-not-configured","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}