From 30142d046f06531e39838011a17ff42f2d01f5c7 Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 19 Jan 2026 12:24:50 +0100 Subject: [PATCH] fix: increase respawn idle timeout to 10s and use consistently - Change default idleTimeoutMs from 5s to 10s - Use configured idle timeout for all step completion checks - Ensures each step (update, /clear, /init) waits properly until idle Co-Authored-By: Claude Opus 4.5 --- src/respawn-controller.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/respawn-controller.ts b/src/respawn-controller.ts index 15daeef8..24528b68 100644 --- a/src/respawn-controller.ts +++ b/src/respawn-controller.ts @@ -52,7 +52,7 @@ export interface RespawnEvents { } const DEFAULT_CONFIG: RespawnConfig = { - idleTimeoutMs: 5000, // 5 seconds of no activity after prompt + idleTimeoutMs: 10000, // 10 seconds of no activity after prompt updatePrompt: 'update all the docs and CLAUDE.md', interStepDelayMs: 1000, // 1 second between steps enabled: true, @@ -316,7 +316,7 @@ export class RespawnController extends EventEmitter { private checkUpdateComplete(data: string): void { // Update is complete when we see the prompt again after working if (this.promptDetected && !this.workingDetected) { - // Wait a bit more to make sure it's truly done + // Wait to make sure it's truly done (use configured idle timeout) this.clearIdleTimer(); this.idleTimer = setTimeout(() => { if (this.promptDetected && !this.workingDetected) { @@ -331,7 +331,7 @@ export class RespawnController extends EventEmitter { this.completeCycle(); } } - }, 3000); // 3 second verification + }, this.config.idleTimeoutMs); // Use configured idle timeout } } @@ -349,7 +349,7 @@ export class RespawnController extends EventEmitter { } private checkClearComplete(data: string): void { - // Clear is fast, just wait for prompt + // Clear is fast, but wait for prompt and verify idle if (this.CLEAR_COMPLETE_PATTERN.test(data) || this.promptDetected) { this.clearIdleTimer(); this.idleTimer = setTimeout(() => { @@ -361,7 +361,7 @@ export class RespawnController extends EventEmitter { } else { this.completeCycle(); } - }, 1000); // 1 second for clear + }, this.config.idleTimeoutMs); // Use configured idle timeout } } @@ -389,7 +389,7 @@ export class RespawnController extends EventEmitter { this.emit('stepCompleted', 'init'); this.completeCycle(); } - }, 3000); // 3 second verification for init + }, this.config.idleTimeoutMs); // Use configured idle timeout } }