mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-03 14:09:42 +02:00
fix: restore auto-compact/auto-clear settings on server restart
Session recovery from screens created fresh Session objects with default values, losing the auto-compact and auto-clear settings that were saved to state.json. Now reads them back during recovery. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1971,6 +1971,24 @@ export class WebServer extends EventEmitter {
|
||||
screenSession: screen // Pass the existing screen so startInteractive() can attach to it
|
||||
});
|
||||
|
||||
// Restore auto-compact/auto-clear settings from state.json
|
||||
const savedState = this.store.getSession(screen.sessionId);
|
||||
if (savedState) {
|
||||
if (savedState.autoCompactEnabled !== undefined || savedState.autoCompactThreshold !== undefined) {
|
||||
session.setAutoCompact(
|
||||
savedState.autoCompactEnabled ?? false,
|
||||
savedState.autoCompactThreshold,
|
||||
savedState.autoCompactPrompt
|
||||
);
|
||||
}
|
||||
if (savedState.autoClearEnabled !== undefined || savedState.autoClearThreshold !== undefined) {
|
||||
session.setAutoClear(
|
||||
savedState.autoClearEnabled ?? false,
|
||||
savedState.autoClearThreshold
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this.sessions.set(session.id, session);
|
||||
this.persistSessionState(session);
|
||||
this.setupSessionListeners(session);
|
||||
|
||||
Reference in New Issue
Block a user