fix(gateway): invalidate bootstrap cache on session rollover (openclaw#38535)

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: yfge <1186273+yfge@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
拐爷&&老拐瘦
2026-03-07 13:46:02 +08:00
committed by GitHub
parent e802840b62
commit 2e31aead39
7 changed files with 63 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import crypto from "node:crypto";
import { clearBootstrapSnapshotOnSessionRollover } from "../../agents/bootstrap-cache.js";
import type { OpenClawConfig } from "../../config/config.js";
import {
evaluateSessionFreshness,
@@ -58,6 +59,11 @@ export function resolveCronSession(params: {
systemSent = false;
}
clearBootstrapSnapshotOnSessionRollover({
sessionKey: params.sessionKey,
previousSessionId: isNewSession ? entry?.sessionId : undefined,
});
const sessionEntry: SessionEntry = {
// Preserve existing per-session overrides even when rolling to a new sessionId.
...entry,