

























@@ -141,11 +141,10 @@ describe("runSessionsSendA2AFlow announce delivery", () => {
141141142142requireGatewayCall("sessions.list");
143143const sendCall = requireGatewayCall("send");
144-expect(sendCall.params).toMatchObject({
145-channel: "discord",
146-to: "channel:target-room",
147- accountId,
148-});
144+const sendParams = sendCall.params as Record<string, unknown>;
145+expect(sendParams.channel).toBe("discord");
146+expect(sendParams.to).toBe("channel:target-room");
147+expect(sendParams.accountId).toBe(accountId);
149148});
150149151150it.each(["NO_REPLY", "HEARTBEAT_OK", "ANNOUNCE_SKIP", "REPLY_SKIP"])(
@@ -188,16 +187,14 @@ describe("runSessionsSendA2AFlow announce delivery", () => {
188187waitRunId: "run-delayed",
189188});
190189191-expect(waitForAgentRun).toHaveBeenCalledWith(
192-expect.objectContaining({
193-runId: "run-delayed",
194-}),
195-);
196-expect(readLatestAssistantReplySnapshot).toHaveBeenCalledWith(
197-expect.objectContaining({
198-sessionKey: "agent:main:discord:group:dev",
199-}),
200-);
190+const waitInput = vi.mocked(waitForAgentRun).mock.calls[0]?.[0] as
191+| { runId?: string }
192+| undefined;
193+expect(waitInput?.runId).toBe("run-delayed");
194+const snapshotInput = vi.mocked(readLatestAssistantReplySnapshot).mock.calls[0]?.[0] as
195+| { sessionKey?: string }
196+| undefined;
197+expect(snapshotInput?.sessionKey).toBe("agent:main:discord:group:dev");
201198expect(runAgentStep).not.toHaveBeenCalled();
202199expect(gatewayCalls.find((call) => call.method === "send")).toBeUndefined();
203200});
@@ -216,12 +213,11 @@ describe("runSessionsSendA2AFlow announce delivery", () => {
216213roundOneReply: "Worker completed successfully",
217214});
218215219-expect(runAgentStep).toHaveBeenCalledWith(
220-expect.objectContaining({
221-message: "Agent-to-agent announce step.",
222-transcriptMessage: "",
223-}),
224-);
216+const stepInput = vi.mocked(runAgentStep).mock.calls[0]?.[0] as
217+| { message?: string; transcriptMessage?: string }
218+| undefined;
219+expect(stepInput?.message).toBe("Agent-to-agent announce step.");
220+expect(stepInput?.transcriptMessage).toBe("");
225221expect(gatewayCalls.find((call) => call.method === "send")).toBeUndefined();
226222},
227223);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。