fix: respawn controller multi-layer detection and cleanup

- Update idle detection from legacy '↵ send' to completion message pattern
  ("for Xm Xs" time patterns like "Worked for 2m 46s")
- Add confirming_idle state for false positive prevention
- Add completionConfirmMs (5s) and noOutputTimeoutMs (30s) config options
- Add multi-layer detection with confidence scoring (0-100%)
- Fix null pointer error in extractTokenCount with guard clause
- Fix respawn controller not stopping on session cleanup (broadcast respawn:stopped)
- Update tests to use new completion message patterns
- Add detection status UI display (confidence level, waiting state)
- Update CLAUDE.md with new detection documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-22 19:24:36 +01:00
co-authored by Claude Opus 4.5
parent 34fb33fbc6
commit ec92e5b1cf
8 changed files with 678 additions and 261 deletions
+38
View File
@@ -486,6 +486,44 @@ body {
font-size: 0.7rem;
}
.respawn-detection {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0 0.5rem;
border-left: 1px solid rgba(34, 197, 94, 0.2);
}
.detection-status {
color: var(--text-muted);
font-size: 0.7rem;
}
.detection-waiting {
color: var(--accent);
font-size: 0.7rem;
font-style: italic;
}
.detection-confidence {
color: var(--text-dim);
font-family: 'SF Mono', Monaco, monospace;
font-size: 0.65rem;
padding: 0.1rem 0.3rem;
background: rgba(34, 197, 94, 0.15);
border-radius: 3px;
}
.detection-confidence.high {
background: rgba(34, 197, 94, 0.3);
color: var(--green);
}
.detection-confidence.medium {
background: rgba(234, 179, 8, 0.2);
color: var(--yellow);
}
@keyframes spin {
to { transform: rotate(360deg); }
}