fix: route agent messageProvider from resolved provider (#389, thanks @imfing)
This commit is contained in:
@@ -58,6 +58,7 @@ describe("gateway server agent", () => {
|
||||
const spy = vi.mocked(agentCommand);
|
||||
const call = spy.mock.calls.at(-1)?.[0] as Record<string, unknown>;
|
||||
expect(call.provider).toBe("whatsapp");
|
||||
expect(call.messageProvider).toBe("whatsapp");
|
||||
expect(call.to).toBe("+436769770569");
|
||||
expect(call.sessionId).toBe("sess-main-stale");
|
||||
|
||||
@@ -138,6 +139,7 @@ describe("gateway server agent", () => {
|
||||
const spy = vi.mocked(agentCommand);
|
||||
const call = spy.mock.calls.at(-1)?.[0] as Record<string, unknown>;
|
||||
expect(call.provider).toBe("whatsapp");
|
||||
expect(call.messageProvider).toBe("whatsapp");
|
||||
expect(call.to).toBe("+1555");
|
||||
expect(call.deliver).toBe(true);
|
||||
expect(call.bestEffortDeliver).toBe(true);
|
||||
@@ -182,6 +184,7 @@ describe("gateway server agent", () => {
|
||||
const spy = vi.mocked(agentCommand);
|
||||
const call = spy.mock.calls.at(-1)?.[0] as Record<string, unknown>;
|
||||
expect(call.provider).toBe("telegram");
|
||||
expect(call.messageProvider).toBe("telegram");
|
||||
expect(call.to).toBe("123");
|
||||
expect(call.deliver).toBe(true);
|
||||
expect(call.bestEffortDeliver).toBe(true);
|
||||
@@ -226,6 +229,7 @@ describe("gateway server agent", () => {
|
||||
const spy = vi.mocked(agentCommand);
|
||||
const call = spy.mock.calls.at(-1)?.[0] as Record<string, unknown>;
|
||||
expect(call.provider).toBe("discord");
|
||||
expect(call.messageProvider).toBe("discord");
|
||||
expect(call.to).toBe("channel:discord-123");
|
||||
expect(call.deliver).toBe(true);
|
||||
expect(call.bestEffortDeliver).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user