mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 15:09:42 +02:00
feat: add AI-powered idle check for respawn controller
Replace the "Worked for Xm Xs" pattern as the sole primary idle detection signal with a final AI-powered check. When pre-filter conditions are met (output silence, no working patterns, tokens stable), a fresh Claude CLI session is spawned in a screen to analyze terminal output and provide a definitive IDLE/WORKING verdict before proceeding with the respawn cycle. New state in state machine: `ai_checking` (between pre-filter confirmation and `sending_update`). WORKING verdict triggers a 3-minute cooldown. Errors auto-disable after 3 consecutive failures, falling back to the existing noOutputTimeoutMs safety net. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -211,6 +211,16 @@ export interface RespawnConfig {
|
||||
autoAcceptPrompts?: boolean;
|
||||
/** Delay before auto-accepting plan mode prompts when no output and no completion message (ms) */
|
||||
autoAcceptDelayMs?: number;
|
||||
/** Whether AI idle check is enabled */
|
||||
aiIdleCheckEnabled?: boolean;
|
||||
/** Model to use for AI idle check */
|
||||
aiIdleCheckModel?: string;
|
||||
/** Maximum characters of terminal buffer for AI check */
|
||||
aiIdleCheckMaxContext?: number;
|
||||
/** Timeout for AI check in ms */
|
||||
aiIdleCheckTimeoutMs?: number;
|
||||
/** Cooldown after WORKING verdict in ms */
|
||||
aiIdleCheckCooldownMs?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -515,6 +525,16 @@ export interface PersistedRespawnConfig {
|
||||
autoAcceptPrompts?: boolean;
|
||||
/** Delay before auto-accepting prompts (ms) */
|
||||
autoAcceptDelayMs?: number;
|
||||
/** Whether AI idle check is enabled */
|
||||
aiIdleCheckEnabled?: boolean;
|
||||
/** Model to use for AI idle check */
|
||||
aiIdleCheckModel?: string;
|
||||
/** Maximum characters of terminal buffer for AI check */
|
||||
aiIdleCheckMaxContext?: number;
|
||||
/** Timeout for AI check in ms */
|
||||
aiIdleCheckTimeoutMs?: number;
|
||||
/** Cooldown after WORKING verdict in ms */
|
||||
aiIdleCheckCooldownMs?: number;
|
||||
/** Duration in minutes if timed respawn was set */
|
||||
durationMinutes?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user