From 5e417b44e1540f528d2ae63e3e20229a902d1db2 Mon Sep 17 00:00:00 2001 From: Tyler Yust Date: Thu, 19 Mar 2026 09:53:43 -0700 Subject: [PATCH] Outbound: skip broadcast channel scan when channel is explicit --- src/infra/outbound/message-action-runner.ts | 12 +++++++----- test/fixtures/test-parallel.behavior.json | 4 ++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/infra/outbound/message-action-runner.ts b/src/infra/outbound/message-action-runner.ts index 318699c1042..d8d40cbe28c 100644 --- a/src/infra/outbound/message-action-runner.ts +++ b/src/infra/outbound/message-action-runner.ts @@ -318,14 +318,16 @@ async function handleBroadcastAction( throw new Error("Broadcast requires at least one target in --targets."); } const channelHint = readStringParam(params, "channel"); - const configured = await listConfiguredMessageChannels(input.cfg); - if (configured.length === 0) { - throw new Error("Broadcast requires at least one configured channel."); - } const targetChannels = channelHint && channelHint.trim().toLowerCase() !== "all" ? [await resolveChannel(input.cfg, { channel: channelHint }, input.toolContext)] - : configured; + : await (async () => { + const configured = await listConfiguredMessageChannels(input.cfg); + if (configured.length === 0) { + throw new Error("Broadcast requires at least one configured channel."); + } + return configured; + })(); const results: Array<{ channel: ChannelId; to: string; diff --git a/test/fixtures/test-parallel.behavior.json b/test/fixtures/test-parallel.behavior.json index 954b5f87557..f1ec0643026 100644 --- a/test/fixtures/test-parallel.behavior.json +++ b/test/fixtures/test-parallel.behavior.json @@ -333,6 +333,10 @@ "file": "src/infra/outbound/message-action-runner.poll.test.ts", "reason": "Terminates cleanly under threads, but not process forks on this host." }, + { + "file": "src/infra/outbound/message-action-runner.context.test.ts", + "reason": "Terminates cleanly under threads, but not process forks on this host." + }, { "file": "src/tts/tts.test.ts", "reason": "Terminates cleanly under threads, but not process forks on this host."