refactor: hybrid indicator+timeout detection in respawn controller

- Primary: Use '↵ send' indicator for immediate response when ready
- Fallback: Use timeout-based detection for prompt patterns
- Add working indicators: Synthesizing, Brewing, ✻, ✽
- Cleaner step completion handlers (checkUpdateComplete, etc.)

The hybrid approach responds immediately when Claude shows the
suggestion indicator, while still having timeout fallback for
reliability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-19 12:32:36 +01:00
co-authored by Claude Opus 4.5
parent a1fb65010d
commit a5b8628e53
2 changed files with 76 additions and 92 deletions
+10 -4
View File
@@ -26,25 +26,31 @@ class MockSession extends EventEmitter {
this.emit('terminal', data);
}
// Simulate prompt appearing
// Simulate prompt appearing (basic prompt character)
simulatePrompt(): void {
this.emit('terminal', '❯ ');
}
// Simulate ready state with the definitive indicator
simulateReady(): void {
this.emit('terminal', '↵ send');
}
// Simulate working state
simulateWorking(): void {
this.emit('terminal', 'Thinking... ⠋');
}
// Simulate clear completion
// Simulate clear completion (followed by ready indicator)
simulateClearComplete(): void {
this.emit('terminal', 'conversation cleared');
setTimeout(() => this.simulateReady(), 50);
}
// Simulate init completion
// Simulate init completion (followed by ready indicator)
simulateInitComplete(): void {
this.emit('terminal', 'Analyzing CLAUDE.md...');
setTimeout(() => this.simulatePrompt(), 100);
setTimeout(() => this.simulateReady(), 100);
}
}