From e057bf4128491c41d9dcfede728b55f8f485d92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Sch=C3=B8yen?= <99178202+ecschoye@users.noreply.github.com> Date: Sun, 15 Feb 2026 14:28:44 -0500 Subject: [PATCH] fix: remove unused import and correct WhatsApp/Email registry status - Remove unused `std::fmt::Write` import in `load_openclaw_bootstrap_files` (eliminates compiler warning) - Update WhatsApp integration status from ComingSoon to config-driven (implementation exists in channels/whatsapp.rs) - Update Email integration status from ComingSoon to config-driven (implementation exists in channels/email_channel.rs) - Update tests to reflect corrected integration statuses Co-authored-by: Claude Opus 4.6 --- src/channels/mod.rs | 1 - src/integrations/registry.rs | 44 ++++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/channels/mod.rs b/src/channels/mod.rs index a85684c..4d5a7b8 100644 --- a/src/channels/mod.rs +++ b/src/channels/mod.rs @@ -78,7 +78,6 @@ fn spawn_supervised_listener( /// Load OpenClaw format bootstrap files into the prompt. fn load_openclaw_bootstrap_files(prompt: &mut String, workspace_dir: &std::path::Path) { - use std::fmt::Write; prompt.push_str("The following workspace files define your identity, behavior, and context.\n\n"); let bootstrap_files = [ diff --git a/src/integrations/registry.rs b/src/integrations/registry.rs index c85ea49..adbab92 100644 --- a/src/integrations/registry.rs +++ b/src/integrations/registry.rs @@ -55,9 +55,15 @@ pub fn all_integrations() -> Vec { }, IntegrationEntry { name: "WhatsApp", - description: "QR pairing via web bridge", + description: "Meta Cloud API via webhook", category: IntegrationCategory::Chat, - status_fn: |_| IntegrationStatus::ComingSoon, + status_fn: |c| { + if c.channels_config.whatsapp.is_some() { + IntegrationStatus::Active + } else { + IntegrationStatus::Available + } + }, }, IntegrationEntry { name: "Signal", @@ -614,9 +620,15 @@ pub fn all_integrations() -> Vec { }, IntegrationEntry { name: "Email", - description: "Send & read emails", + description: "IMAP/SMTP email channel", category: IntegrationCategory::Social, - status_fn: |_| IntegrationStatus::ComingSoon, + status_fn: |c| { + if c.channels_config.email.is_some() { + IntegrationStatus::Active + } else { + IntegrationStatus::Available + } + }, }, // ── Platforms ─────────────────────────────────────────── IntegrationEntry { @@ -798,7 +810,7 @@ mod tests { fn coming_soon_integrations_stay_coming_soon() { let config = Config::default(); let entries = all_integrations(); - for name in ["WhatsApp", "Signal", "Nostr", "Spotify", "Home Assistant"] { + for name in ["Signal", "Nostr", "Spotify", "Home Assistant"] { let entry = entries.iter().find(|e| e.name == name).unwrap(); assert!( matches!((entry.status_fn)(&config), IntegrationStatus::ComingSoon), @@ -807,6 +819,28 @@ mod tests { } } + #[test] + fn whatsapp_available_when_not_configured() { + let config = Config::default(); + let entries = all_integrations(); + let wa = entries.iter().find(|e| e.name == "WhatsApp").unwrap(); + assert!(matches!( + (wa.status_fn)(&config), + IntegrationStatus::Available + )); + } + + #[test] + fn email_available_when_not_configured() { + let config = Config::default(); + let entries = all_integrations(); + let email = entries.iter().find(|e| e.name == "Email").unwrap(); + assert!(matches!( + (email.status_fn)(&config), + IntegrationStatus::Available + )); + } + #[test] fn shell_and_filesystem_always_active() { let config = Config::default();