mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:20:43 +00:00
fix(gateway,agent): only enforce session sendPolicy=deny when delivering
This commit is contained in:
@@ -2833,6 +2833,12 @@ describe("gateway agent handler", () => {
|
||||
undefined,
|
||||
expect.objectContaining({ message: "send blocked by session policy" }),
|
||||
);
|
||||
expect(mocks.resolveSendPolicy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
entry: expect.objectContaining({ sessionId: "existing-session-id" }),
|
||||
sessionKey: "agent:main:main",
|
||||
}),
|
||||
);
|
||||
expect(mocks.agentCommand).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
@@ -1072,10 +1072,10 @@ export const agentHandlers: GatewayRequestHandlers = {
|
||||
if (request.deliver === true) {
|
||||
const sendPolicy = resolveSendPolicy({
|
||||
cfg,
|
||||
entry,
|
||||
entry: sessionEntry,
|
||||
sessionKey: canonicalKey,
|
||||
channel: entry?.channel,
|
||||
chatType: entry?.chatType,
|
||||
channel: sessionEntry?.channel,
|
||||
chatType: sessionEntry?.chatType,
|
||||
});
|
||||
if (sendPolicy === "deny") {
|
||||
respond(
|
||||
|
||||
Reference in New Issue
Block a user