mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:30:44 +00:00
fix(gateway,agent): only enforce session sendPolicy=deny when delivering
This commit is contained in:
@@ -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",
|
sessionKey: "cron:job-1",
|
||||||
message: "hi",
|
message: "hi",
|
||||||
idempotencyKey: "idem-2",
|
idempotencyKey: "idem-2",
|
||||||
});
|
});
|
||||||
expect(agentBlockedRes.ok).toBe(false);
|
expect(agentAllowedRes.ok).toBe(true);
|
||||||
expect((agentBlockedRes.error as { message?: string } | undefined)?.message ?? "").toMatch(
|
expect(agentAllowedRes.payload?.status).toBe("accepted");
|
||||||
/send blocked/i,
|
expect(agentAllowedRes.payload?.runId).toBe("idem-2");
|
||||||
);
|
await vi.waitFor(() => expect(agentCommand).toHaveBeenCalled());
|
||||||
|
|
||||||
testState.sessionStorePath = undefined;
|
testState.sessionStorePath = undefined;
|
||||||
testState.sessionConfig = undefined;
|
testState.sessionConfig = undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user