Skip to content

Commit 5e417b4

Browse files
committed
Outbound: skip broadcast channel scan when channel is explicit
1 parent b71686a commit 5e417b4

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/infra/outbound/message-action-runner.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,16 @@ async function handleBroadcastAction(
318318
throw new Error("Broadcast requires at least one target in --targets.");
319319
}
320320
const channelHint = readStringParam(params, "channel");
321-
const configured = await listConfiguredMessageChannels(input.cfg);
322-
if (configured.length === 0) {
323-
throw new Error("Broadcast requires at least one configured channel.");
324-
}
325321
const targetChannels =
326322
channelHint && channelHint.trim().toLowerCase() !== "all"
327323
? [await resolveChannel(input.cfg, { channel: channelHint }, input.toolContext)]
328-
: configured;
324+
: await (async () => {
325+
const configured = await listConfiguredMessageChannels(input.cfg);
326+
if (configured.length === 0) {
327+
throw new Error("Broadcast requires at least one configured channel.");
328+
}
329+
return configured;
330+
})();
329331
const results: Array<{
330332
channel: ChannelId;
331333
to: string;

test/fixtures/test-parallel.behavior.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@
333333
"file": "src/infra/outbound/message-action-runner.poll.test.ts",
334334
"reason": "Terminates cleanly under threads, but not process forks on this host."
335335
},
336+
{
337+
"file": "src/infra/outbound/message-action-runner.context.test.ts",
338+
"reason": "Terminates cleanly under threads, but not process forks on this host."
339+
},
336340
{
337341
"file": "src/tts/tts.test.ts",
338342
"reason": "Terminates cleanly under threads, but not process forks on this host."

0 commit comments

Comments
 (0)