fix: add step confirmation to respawn controller

- Add step confirmation timer for waiting_update, waiting_init, waiting_kickstart states
- After detecting completion in waiting states, wait for completionConfirmMs silence
- Prevents sending next command before Claude finishes processing current one
- Cancel step confirmation when working patterns detected
- Update CLAUDE.md with step confirmation documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-22 19:31:24 +01:00
co-authored by Claude Opus 4.5
parent ec92e5b1cf
commit 5a97403066
2 changed files with 82 additions and 11 deletions
+2
View File
@@ -285,6 +285,8 @@ curl -X POST localhost:3000/api/sessions/:id/input \
Uses `confirming_idle` state to prevent false positives. Fallback: `noOutputTimeoutMs` (30s) if no output at all.
**Step Confirmation**: After sending each respawn step (update, init, kickstart), the controller waits for the same `completionConfirmMs` silence before proceeding. This ensures Claude finishes processing each prompt before the next command is sent.
**Session**: emits `idle`/`working` events on prompt detection + 2s activity timeout.
### Token Tracking