From 2a1e42c8a033013caaf97495c426d97ec9190c1d Mon Sep 17 00:00:00 2001 From: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Date: Sun, 3 May 2026 00:11:25 +0000 Subject: [PATCH] fix(gateway,agent): only enforce session sendPolicy=deny when delivering --- src/gateway/server.chat.gateway-server-chat.test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gateway/server.chat.gateway-server-chat.test.ts b/src/gateway/server.chat.gateway-server-chat.test.ts index 0afbe341934..aab3d3cf7d7 100644 --- a/src/gateway/server.chat.gateway-server-chat.test.ts +++ b/src/gateway/server.chat.gateway-server-chat.test.ts @@ -488,15 +488,16 @@ describe("gateway server chat", () => { }, }); - const agentBlockedRes = await rpcReq(ws, "agent", { + vi.mocked(agentCommand).mockClear(); + const agentAllowedRes = await rpcReq(ws, "agent", { sessionKey: "cron:job-1", message: "hi", idempotencyKey: "idem-2", }); - expect(agentBlockedRes.ok).toBe(false); - expect((agentBlockedRes.error as { message?: string } | undefined)?.message ?? "").toMatch( - /send blocked/i, - ); + expect(agentAllowedRes.ok).toBe(true); + expect(agentAllowedRes.payload?.status).toBe("accepted"); + expect(agentAllowedRes.payload?.runId).toBe("idem-2"); + await vi.waitFor(() => expect(agentCommand).toHaveBeenCalled()); testState.sessionStorePath = undefined; testState.sessionConfig = undefined;