feat(openclaw): add repair function for ClawX-only bootstrap files an… (#180)

This commit is contained in:
Haze
2026-02-26 11:55:19 +08:00
committed by GitHub
Unverified
parent 96ac13fd90
commit 1ca0017f85
3 changed files with 76 additions and 10 deletions

View File

@@ -1009,6 +1009,18 @@ export const useChatStore = create<ChatState>((set, get) => ({
// ── New session ──
newSession: () => {
const { currentSessionKey } = get();
// Notify the gateway that the old session is ending so the session-memory
// hook can persist conversation memories to memory/YYYY-MM-DD-<slug>.md.
if (currentSessionKey) {
void window.electron.ipcRenderer.invoke(
'gateway:rpc',
'sessions.reset',
{ key: currentSessionKey, reason: 'new' },
).catch(() => { /* fire-and-forget */ });
}
// Generate a new unique session key and switch to it
const prefix = getCanonicalPrefixFromSessions(get().sessions) ?? DEFAULT_CANONICAL_PREFIX;
const newKey = `${prefix}:session-${Date.now()}`;