mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-02 12:51:57 +00:00
* perf(inbound): trim cold startup import graph * chore(reply): drop redundant inline action type import * fix(inbound): restore warning and maintenance seams * fix(reply): restore type seam and secure forked transcripts
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { updateSessionStore } from "../../config/sessions/store.js";
|
|
import type { SessionEntry } from "../../config/sessions/types.js";
|
|
import { applyAbortCutoffToSessionEntry, hasAbortCutoff } from "./abort-cutoff.js";
|
|
|
|
export async function clearAbortCutoffInSessionRuntime(params: {
|
|
sessionEntry?: SessionEntry;
|
|
sessionStore?: Record<string, SessionEntry>;
|
|
sessionKey?: string;
|
|
storePath?: string;
|
|
}): Promise<boolean> {
|
|
const { sessionEntry, sessionStore, sessionKey, storePath } = params;
|
|
if (!sessionEntry || !sessionStore || !sessionKey || !hasAbortCutoff(sessionEntry)) {
|
|
return false;
|
|
}
|
|
|
|
applyAbortCutoffToSessionEntry(sessionEntry, undefined);
|
|
sessionEntry.updatedAt = Date.now();
|
|
sessionStore[sessionKey] = sessionEntry;
|
|
|
|
if (storePath) {
|
|
await updateSessionStore(storePath, (store) => {
|
|
const existing = store[sessionKey] ?? sessionEntry;
|
|
if (!existing) {
|
|
return;
|
|
}
|
|
applyAbortCutoffToSessionEntry(existing, undefined);
|
|
existing.updatedAt = Date.now();
|
|
store[sessionKey] = existing;
|
|
});
|
|
}
|
|
|
|
return true;
|
|
}
|