mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 16:20:21 +00:00
fix(cron): force fresh isolated session IDs
This commit is contained in:
@@ -327,6 +327,16 @@ describe("runCronIsolatedAgentTurn — skill filter", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("forces a fresh session for isolated cron runs", async () => {
|
||||
const result = await runCronIsolatedAgentTurn(makeParams());
|
||||
|
||||
expect(result.status).toBe("ok");
|
||||
expect(resolveCronSessionMock).toHaveBeenCalledOnce();
|
||||
expect(resolveCronSessionMock.mock.calls[0]?.[0]).toMatchObject({
|
||||
forceNew: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("reuses cached snapshot when version and normalized skillFilter are unchanged", async () => {
|
||||
resolveAgentSkillsFilterMock.mockReturnValue([" weather ", "meme-factory", "weather"]);
|
||||
resolveCronSessionMock.mockReturnValue({
|
||||
|
||||
@@ -270,6 +270,8 @@ export async function runCronIsolatedAgentTurn(params: {
|
||||
sessionKey: agentSessionKey,
|
||||
agentId,
|
||||
nowMs: now,
|
||||
// Isolated cron runs must not carry prior turn context across executions.
|
||||
forceNew: params.job.sessionTarget === "isolated",
|
||||
});
|
||||
const runSessionId = cronSession.sessionEntry.sessionId;
|
||||
const runSessionKey = baseSessionKey.startsWith("cron:")
|
||||
|
||||
Reference in New Issue
Block a user