feat: persist respawn config and inner loop state across server restarts

- Add PersistedRespawnConfig type and respawnConfig field to ScreenSession
- Add innerLoopEnabled field to ScreenSession for Ralph Wiggum tracking
- Add updateRespawnConfig, clearRespawnConfig, updateInnerLoopEnabled methods to ScreenManager
- Save respawn config when enabled/updated via API endpoints
- Save inner loop enabled state when changed via API
- Restore respawn controllers and inner loop state on server startup

This ensures respawn continues working after claudeman restarts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-21 18:30:06 +01:00
co-authored by Claude Opus 4.5
parent 6bfc7f9027
commit e469b30ddb
3 changed files with 120 additions and 1 deletions
+27
View File
@@ -433,6 +433,29 @@ export interface CaseInfo {
*
* Claudeman uses GNU screen for session persistence across server restarts.
*/
/**
* Persisted respawn configuration for screen sessions.
* Subset of RespawnConfig that gets saved to disk.
*/
export interface PersistedRespawnConfig {
/** Whether respawn was enabled */
enabled: boolean;
/** How long to wait after seeing prompt before considering truly idle (ms) */
idleTimeoutMs: number;
/** The prompt to send for updating docs */
updatePrompt: string;
/** Delay between sending steps (ms) */
interStepDelayMs: number;
/** Whether to send /clear after update prompt */
sendClear: boolean;
/** Whether to send /init after /clear */
sendInit: boolean;
/** Optional prompt to send if /init doesn't trigger work */
kickstartPrompt?: string;
/** Duration in minutes if timed respawn was set */
durationMinutes?: number;
}
export interface ScreenSession {
/** Claudeman session ID */
sessionId: string;
@@ -450,6 +473,10 @@ export interface ScreenSession {
attached: boolean;
/** Session display name (tab name) */
name?: string;
/** Persisted respawn controller configuration (restored on server restart) */
respawnConfig?: PersistedRespawnConfig;
/** Whether inner loop (Ralph Wiggum) tracking is enabled */
innerLoopEnabled?: boolean;
}
/**