Skip to content

Commit 1288a5d

Browse files
committed
fix(daemon,onboard): include webhook in channel supervisor and launch checks
has_supervised_channels() and has_launchable_channels() both called channels_except_webhook(), causing webhook-only configs to never start the channel supervisor and never show the launch prompt in the wizard. Change both callsites to channels(), which includes webhook with the same is_some() check used by every other channel. Fixes #5798
1 parent 9753bc7 commit 1288a5d

2 files changed

Lines changed: 33 additions & 7 deletions

File tree

β€Žcrates/zeroclaw-runtime/src/daemon/mod.rsβ€Ž

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub async fn run(
143143
));
144144
} else {
145145
crate::health::mark_component_ok("channels");
146-
tracing::info!("No real-time channels configured; channel supervisor disabled");
146+
tracing::info!("No channels configured; channel supervisor disabled");
147147
}
148148
} else {
149149
crate::health::mark_component_ok("channels");
@@ -960,11 +960,7 @@ fn validate_heartbeat_channel_config(config: &Config, channel: &str) -> Result<(
960960
}
961961

962962
fn has_supervised_channels(config: &Config) -> bool {
963-
config
964-
.channels
965-
.channels_except_webhook()
966-
.iter()
967-
.any(|(_, ok)| *ok)
963+
config.channels.channels().iter().any(|(_, ok)| *ok)
968964
}
969965

970966
// run_mqtt_sop_listener has been moved to zeroclaw-channels::orchestrator::mqtt.
@@ -1117,6 +1113,21 @@ mod tests {
11171113
assert!(has_supervised_channels(&config));
11181114
}
11191115

1116+
#[test]
1117+
fn webhook_only_config_is_supervised() {
1118+
let mut config = Config::default();
1119+
config.channels.webhook = Some(zeroclaw_config::schema::WebhookConfig {
1120+
enabled: true,
1121+
port: 8080,
1122+
listen_path: None,
1123+
send_url: None,
1124+
send_method: None,
1125+
auth_header: None,
1126+
secret: None,
1127+
});
1128+
assert!(has_supervised_channels(&config));
1129+
}
1130+
11201131
#[test]
11211132
fn resolve_delivery_none_when_unset() {
11221133
let config = Config::default();

β€Žcrates/zeroclaw-runtime/src/onboard/wizard.rsβ€Ž

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const MODEL_CACHE_TTL_SECS: u64 = 12 * 60 * 60;
9494
const CUSTOM_MODEL_SENTINEL: &str = "__custom_model__";
9595

9696
fn has_launchable_channels(channels: &ChannelsConfig) -> bool {
97-
channels.channels_except_webhook().iter().any(|(_, ok)| *ok)
97+
channels.channels().iter().any(|(_, ok)| *ok)
9898
}
9999

100100
// ── Main wizard entry point ──────────────────────────────────────
@@ -7853,6 +7853,21 @@ mod tests {
78537853
assert!(has_launchable_channels(&channels));
78547854
}
78557855

7856+
#[test]
7857+
fn webhook_only_config_is_launchable() {
7858+
let mut channels = ChannelsConfig::default();
7859+
channels.webhook = Some(zeroclaw_config::schema::WebhookConfig {
7860+
enabled: true,
7861+
port: 8080,
7862+
listen_path: None,
7863+
send_url: None,
7864+
send_method: None,
7865+
auth_header: None,
7866+
secret: None,
7867+
});
7868+
assert!(has_launchable_channels(&channels));
7869+
}
7870+
78567871
#[test]
78577872
fn channels_repair_preserves_unmodified_channels() {
78587873
use zeroclaw_config::schema::{DiscordConfig, MatrixConfig, StreamMode};

0 commit comments

Comments
Β (0)