zeroclaw-labs/zeroclaw · error · anyhow::Error
iMessage channel requires the `channel-imessage` feature
Error message
iMessage channel requires the `channel-imessage` feature
What it means
Raised by build_channel_by_id when channel_id = "imessage" is requested and the binary was compiled without the `channel-imessage` feature. The feature-on arm (which would check for the "default" config entry and build IMessageChannel) is cfg'd out; only the bail remains. iMessage is a cfg-gate-only feature (no optional deps), so enabling it is cheap.
Source
Thrown at crates/zeroclaw-channels/src/orchestrator/mod.rs:9619
"mochat" => {
anyhow::bail!("Mochat channel requires the `channel-mochat` feature");
}
#[cfg(feature = "channel-imessage")]
"imessage" => {
if !config.channels.imessage.contains_key("default") {
anyhow::bail!("iMessage channel is not configured");
}
let alias = "default".to_string();
let peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync> = {
let cfg_arc = config_arc.clone();
let alias = alias.clone();
Arc::new(move || cfg_arc.read().channel_external_peers("imessage", &alias))
};
Ok(Arc::new(IMessageChannel::new(alias, peer_resolver)))
}
#[cfg(not(feature = "channel-imessage"))]
"imessage" => {
anyhow::bail!("iMessage channel requires the `channel-imessage` feature");
}
"line" => {
#[cfg(feature = "channel-line")]
{
let ln = config
.channels
.line
.get("default")
.context("LINE channel is not configured")?;
let alias = "default".to_string();
let peer_resolver: Arc<dyn Fn() -> Vec<String> + Send + Sync> = {
let cfg_arc = config_arc.clone();
let alias = alias.clone();
Arc::new(move || cfg_arc.read().channel_external_peers("line", &alias))
};
let sender_name_resolver: Arc<dyn Fn() -> Option<String> + Send + Sync> = {
let cfg_arc = config_arc.clone();
let alias = alias.clone();View on GitHub (pinned to 88bb9c8533)
Solutions
- Rebuild with cargo build --release --features channel-imessage
- Or use --features channels-full
- Or remove the "imessage" binding / channel config
- After rebuilding, ensure [channels.imessage.default] exists or you will next hit "iMessage channel is not configured"
Example fix
# before cargo build --release # after cargo build --release --features channel-imessage
Defensive patterns
Strategy: validation
Validate before calling
use zeroclaw_channels::listing::is_channel_type_compiled;
if !is_channel_type_compiled("imessage") {
eprintln!("rebuild with --features channel-imessage or remove the imessage binding");
} Type guard
fn imessage_available() -> bool {
zeroclaw_channels::listing::is_channel_type_compiled("imessage")
} Try / catch
match build_channel_by_id(&config_arc, "imessage") {
Ok(ch) => { /* use */ }
Err(e) if e.to_string().contains("requires the `channel-imessage` feature") => {
// rebuild needed; config changes will not help
}
Err(e) if e.to_string() == "iMessage channel is not configured" => {
// different error: compiled in, add [channels.imessage.default]
}
Err(e) => return Err(e),
} Prevention
- Two distinct imessage failures share this arm: feature missing vs default config missing — check the message before acting
- channel-imessage is dependency-free, so including it in standard build profiles costs nothing
When it happens
Trigger: start_channels / build_channel_by_id selecting "imessage" from an agent binding or channels config in a build without --features channel-imessage.
Common situations: Default-feature builds (imessage is in channels-full only); macOS hosts where the operator assumed iMessage ships by default; slim binaries built for Linux servers that later get an imessage binding in shared config.
Related errors
- QQ channel requires the `channel-qq` feature
- Lark channel requires the `channel-lark` feature
- DingTalk channel requires the `channel-dingtalk` feature
- WeCom channel requires the `channel-wecom` feature
- WeCom WebSocket channel requires the `channel-wecom-ws` feat
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/3d9a533e7e352d65.
Report an issue: GitHub.