fix(outbound): return error instead of silently redirecting to allowList[0] (#13578)

This commit is contained in:
Marcus Castro
2026-02-13 01:20:03 -03:00
committed by GitHub
parent a43136c85e
commit 39ee708df6
11 changed files with 392 additions and 74 deletions

View File

@@ -198,7 +198,7 @@ describe("resolveHeartbeatDeliveryTarget", () => {
});
});
it("applies allowFrom fallback for WhatsApp targets", () => {
it("rejects WhatsApp target not in allowFrom (no silent fallback)", () => {
const cfg: OpenClawConfig = {
agents: { defaults: { heartbeat: { target: "whatsapp", to: "+1999" } } },
channels: { whatsapp: { allowFrom: ["+1555", "+1666"] } },
@@ -209,9 +209,8 @@ describe("resolveHeartbeatDeliveryTarget", () => {
lastTo: "+1222",
};
expect(resolveHeartbeatDeliveryTarget({ cfg, entry })).toEqual({
channel: "whatsapp",
to: "+1555",
reason: "allowFrom-fallback",
channel: "none",
reason: "no-target",
accountId: undefined,
lastChannel: "whatsapp",
lastAccountId: undefined,