fix: stop hardcoded channel fallback and auto-pick sole configured channel (#23357) (thanks @lbo728)

Co-authored-by: lbo728 <extreme0728@gmail.com>
This commit is contained in:
Peter Steinberger
2026-02-22 11:20:33 +01:00
parent e33d7fcd13
commit 1cd3b30907
18 changed files with 355 additions and 91 deletions

View File

@@ -59,6 +59,19 @@ describe("agent delivery helpers", () => {
expect(resolved.resolvedTo).toBe("+1999");
});
it("does not inject a default deliverable channel when session has none", () => {
const plan = resolveAgentDeliveryPlan({
sessionEntry: undefined,
requestedChannel: "last",
explicitTo: undefined,
accountId: undefined,
wantsDelivery: true,
});
expect(plan.resolvedChannel).toBe("webchat");
expect(plan.deliveryTargetMode).toBeUndefined();
});
it("skips outbound target resolution when explicit target validation is disabled", () => {
const plan = resolveAgentDeliveryPlan({
sessionEntry: {