From 1b97ef4feb07dfd24a878be9c3dd2fd32e1106d4 Mon Sep 17 00:00:00 2001 From: Illia Polosukhin Date: Fri, 20 Mar 2026 00:41:20 -0700 Subject: [PATCH] fix: resolve wasm broadcast merge conflicts with staging (#395) (#1460) * channels/wasm: implement telegram broadcast path for message tool * channels/wasm: tighten telegram broadcast contract and tests * fix: resolve merge conflicts with staging for wasm broadcast - Remove duplicate broadcast() impls from WasmChannel and SharedWasmChannel (staging already has the generic call_on_broadcast path) - Remove obsolete telegram-specific test helpers and tests that tested the old telegram-only broadcast logic - Add test_broadcast_delegates_to_call_on_broadcast for the generic path - Fix missing fallback_deliverable field in job_monitor test SseEvents Co-Authored-By: Claude Opus 4.6 (1M context) --------- Co-authored-by: davidpty <127684147+davidpty@users.noreply.github.com> Co-authored-by: firat.sertgoz Co-authored-by: Claude Opus 4.6 (1M context) --- src/agent/job_monitor.rs | 3 +++ src/channels/wasm/wrapper.rs | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/agent/job_monitor.rs b/src/agent/job_monitor.rs index 3f038764..675d0426 100644 --- a/src/agent/job_monitor.rs +++ b/src/agent/job_monitor.rs @@ -421,6 +421,7 @@ mod tests { job_id: job_id.to_string(), status: "completed".to_string(), session_id: None, + fallback_deliverable: None, }, )) .unwrap(); @@ -468,6 +469,7 @@ mod tests { job_id: job_id.to_string(), status: "failed".to_string(), session_id: None, + fallback_deliverable: None, }, )) .unwrap(); @@ -506,6 +508,7 @@ mod tests { job_id: job_id.to_string(), status: "completed".to_string(), session_id: None, + fallback_deliverable: None, }, )) .unwrap(); diff --git a/src/channels/wasm/wrapper.rs b/src/channels/wasm/wrapper.rs index 8f0c9db4..be7768d0 100644 --- a/src/channels/wasm/wrapper.rs +++ b/src/channels/wasm/wrapper.rs @@ -3314,6 +3314,7 @@ mod tests { use std::sync::Arc; use crate::channels::Channel; + use crate::channels::OutgoingResponse; use crate::channels::wasm::capabilities::ChannelCapabilities; use crate::channels::wasm::runtime::{ PreparedChannelModule, WasmChannelRuntime, WasmChannelRuntimeConfig, @@ -3401,6 +3402,16 @@ mod tests { assert!(channel.health_check().await.is_err()); } + #[tokio::test] + async fn test_broadcast_delegates_to_call_on_broadcast() { + let channel = create_test_channel(); + // With `component: None`, call_on_broadcast short-circuits to Ok(()). + let result = channel + .broadcast("146032821", OutgoingResponse::text("hello")) + .await; + assert!(result.is_ok()); + } + #[tokio::test] async fn test_execute_poll_no_wasm_returns_empty() { // When there's no WASM module (None component), execute_poll