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

@@ -20,6 +20,17 @@ export function clearBootstrapSnapshot(sessionKey: string): void {
cache.delete(sessionKey);
}
export function clearBootstrapSnapshotOnSessionRollover(params: {
sessionKey?: string;
previousSessionId?: string;
}): void {
if (!params.sessionKey || !params.previousSessionId) {
return;
}
clearBootstrapSnapshot(params.sessionKey);
}
export function clearAllBootstrapSnapshots(): void {
cache.clear();
}