mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 11:07:41 +00:00
Discord: honor accountId across channel actions (refs #1489)
This commit is contained in:
@@ -5,6 +5,10 @@ vi.mock("../../gateway/call.js", () => ({
|
||||
callGateway: (opts: unknown) => callGatewayMock(opts),
|
||||
}));
|
||||
|
||||
vi.mock("../agent-scope.js", () => ({
|
||||
resolveSessionAgentId: () => "agent-123",
|
||||
}));
|
||||
|
||||
import { createCronTool } from "./cron-tool.js";
|
||||
|
||||
describe("cron tool", () => {
|
||||
@@ -85,6 +89,23 @@ describe("cron tool", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("does not default agentId when job.agentId is null", async () => {
|
||||
const tool = createCronTool({ agentSessionKey: "main" });
|
||||
await tool.execute("call-null", {
|
||||
action: "add",
|
||||
job: {
|
||||
name: "wake-up",
|
||||
schedule: { atMs: 123 },
|
||||
agentId: null,
|
||||
},
|
||||
});
|
||||
|
||||
const call = callGatewayMock.mock.calls[0]?.[0] as {
|
||||
params?: { agentId?: unknown };
|
||||
};
|
||||
expect(call?.params?.agentId).toBeNull();
|
||||
});
|
||||
|
||||
it("adds recent context for systemEvent reminders when contextMessages > 0", async () => {
|
||||
callGatewayMock
|
||||
.mockResolvedValueOnce({
|
||||
|
||||
Reference in New Issue
Block a user