mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 00:19:42 +02:00
feat: add AI-powered plan mode detection for auto-accept
Adds a two-stage gate before auto-accepting plan mode prompts: 1. Strict regex pre-filter - checks for numbered options + selector 2. AI confirmation - spawns Opus to classify as PLAN_MODE or NOT_PLAN_MODE This prevents spurious Enter key presses when Claude is paused mid-thought or experiencing network lag, rather than showing a plan approval prompt. New files: - src/ai-plan-checker.ts: AI checker following ai-idle-checker.ts pattern Config fields added to RespawnConfig: - aiPlanCheckEnabled (default: true) - aiPlanCheckModel (default: claude-opus-4-5-20251101) - aiPlanCheckMaxContext (default: 8000) - aiPlanCheckTimeoutMs (default: 60000) - aiPlanCheckCooldownMs (default: 30000) New events: planCheckStarted, planCheckCompleted, planCheckFailed Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -221,6 +221,16 @@ export interface RespawnConfig {
|
||||
aiIdleCheckTimeoutMs?: number;
|
||||
/** Cooldown after WORKING verdict in ms */
|
||||
aiIdleCheckCooldownMs?: number;
|
||||
/** Whether AI plan mode check is enabled for auto-accept */
|
||||
aiPlanCheckEnabled?: boolean;
|
||||
/** Model to use for AI plan mode check */
|
||||
aiPlanCheckModel?: string;
|
||||
/** Maximum characters of terminal buffer for plan check */
|
||||
aiPlanCheckMaxContext?: number;
|
||||
/** Timeout for AI plan check in ms */
|
||||
aiPlanCheckTimeoutMs?: number;
|
||||
/** Cooldown after NOT_PLAN_MODE verdict in ms */
|
||||
aiPlanCheckCooldownMs?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -535,6 +545,16 @@ export interface PersistedRespawnConfig {
|
||||
aiIdleCheckTimeoutMs?: number;
|
||||
/** Cooldown after WORKING verdict in ms */
|
||||
aiIdleCheckCooldownMs?: number;
|
||||
/** Whether AI plan mode check is enabled for auto-accept */
|
||||
aiPlanCheckEnabled?: boolean;
|
||||
/** Model to use for AI plan mode check */
|
||||
aiPlanCheckModel?: string;
|
||||
/** Maximum characters of terminal buffer for plan check */
|
||||
aiPlanCheckMaxContext?: number;
|
||||
/** Timeout for AI plan check in ms */
|
||||
aiPlanCheckTimeoutMs?: number;
|
||||
/** Cooldown after NOT_PLAN_MODE verdict in ms */
|
||||
aiPlanCheckCooldownMs?: number;
|
||||
/** Duration in minutes if timed respawn was set */
|
||||
durationMinutes?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user