fix: persist respawnEnabled state to state.json

The respawn controller's enabled/disabled state was not being saved,
so CLI status couldn't show whether respawn was active.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-22 20:52:41 +01:00
co-authored by Claude Opus 4.5
parent e5aff372e8
commit 23c75578c0
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -74,6 +74,8 @@ export interface SessionState {
inputTokens?: number;
/** Output tokens used */
outputTokens?: number;
/** Whether respawn controller is currently enabled/running */
respawnEnabled?: boolean;
/** Respawn controller config (if enabled) */
respawnConfig?: RespawnConfig & { durationMinutes?: number };
/** Ralph / Todo tracker enabled */
+3
View File
@@ -1289,6 +1289,9 @@ export class WebServer extends EventEmitter {
? Math.round((timerInfo.endAt - timerInfo.startedAt) / 60000)
: undefined;
state.respawnConfig = { ...config, durationMinutes };
state.respawnEnabled = controller.state !== 'stopped';
} else {
state.respawnEnabled = false;
}
this.store.setSession(session.id, state);
}