fix(routing): handle cross-provider messages in collect mode
When queued messages come from different providers (Slack + Telegram), process them individually instead of collecting into a single prompt. This ensures each reply routes back to its originating provider. - Add hasCrossProviderItems() to detect multi-provider queues - Skip collect mode when cross-provider detected - Preserve originatingChannel/originatingTo when collecting same-provider
This commit is contained in:
committed by
Peter Steinberger
parent
2d67ec5bfa
commit
5414da9fd4
@@ -82,9 +82,13 @@ export function createFollowupRunner(params: {
|
||||
cfg: queued.run.config,
|
||||
});
|
||||
if (!result.ok) {
|
||||
logVerbose(
|
||||
`followup queue: route-reply failed: ${result.error ?? "unknown error"}`,
|
||||
);
|
||||
// Log error and fall back to dispatcher if available.
|
||||
const errorMsg = result.error ?? "unknown error";
|
||||
logVerbose(`followup queue: route-reply failed: ${errorMsg}`);
|
||||
// Fallback: try the dispatcher if routing failed.
|
||||
if (opts?.onBlockReply) {
|
||||
await opts.onBlockReply(payload);
|
||||
}
|
||||
}
|
||||
} else if (opts?.onBlockReply) {
|
||||
await opts.onBlockReply(payload);
|
||||
|
||||
Reference in New Issue
Block a user