Outbound: skip broadcast channel scan when channel is explicit

This commit is contained in:
Tyler Yust 2026-03-19 09:53:43 -07:00
parent b71686ab44
commit 5e417b44e1
2 changed files with 11 additions and 5 deletions

View File

@ -318,14 +318,16 @@ async function handleBroadcastAction(
throw new Error("Broadcast requires at least one target in --targets."); throw new Error("Broadcast requires at least one target in --targets.");
} }
const channelHint = readStringParam(params, "channel"); 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 = const targetChannels =
channelHint && channelHint.trim().toLowerCase() !== "all" channelHint && channelHint.trim().toLowerCase() !== "all"
? [await resolveChannel(input.cfg, { channel: channelHint }, input.toolContext)] ? [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<{ const results: Array<{
channel: ChannelId; channel: ChannelId;
to: string; to: string;

View File

@ -333,6 +333,10 @@
"file": "src/infra/outbound/message-action-runner.poll.test.ts", "file": "src/infra/outbound/message-action-runner.poll.test.ts",
"reason": "Terminates cleanly under threads, but not process forks on this host." "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", "file": "src/tts/tts.test.ts",
"reason": "Terminates cleanly under threads, but not process forks on this host." "reason": "Terminates cleanly under threads, but not process forks on this host."