test(gateway): cover internal provider defaults

This commit is contained in:
Peter Steinberger
2026-01-09 22:40:32 +01:00
parent 92cc7a841c
commit f8bf041396
4 changed files with 75 additions and 1 deletions

View File

@@ -268,7 +268,10 @@ describe("sessions tools", () => {
);
expect(agentCalls).toHaveLength(8);
for (const call of agentCalls) {
expect(call.params).toMatchObject({ lane: "nested" });
expect(call.params).toMatchObject({
lane: "nested",
provider: "webchat",
});
}
expect(
agentCalls.some(
@@ -394,6 +397,15 @@ describe("sessions tools", () => {
await new Promise((resolve) => setTimeout(resolve, 0));
await new Promise((resolve) => setTimeout(resolve, 0));
const agentCalls = calls.filter((call) => call.method === "agent");
expect(agentCalls).toHaveLength(4);
for (const call of agentCalls) {
expect(call.params).toMatchObject({
lane: "nested",
provider: "webchat",
});
}
const replySteps = calls.filter(
(call) =>
call.method === "agent" &&

View File

@@ -169,6 +169,12 @@ describe("subagents", () => {
expect(first?.provider).toBe("discord");
expect(first?.sessionKey?.startsWith("agent:main:subagent:")).toBe(true);
expect(childSessionKey?.startsWith("agent:main:subagent:")).toBe(true);
const second = agentCalls[1]?.params as
| { provider?: string; deliver?: boolean; lane?: string }
| undefined;
expect(second?.lane).toBe("nested");
expect(second?.deliver).toBe(false);
expect(second?.provider).toBe("webchat");
expect(sendParams.provider).toBe("discord");
expect(sendParams.to).toBe("channel:req");