← Back to Kontasks
Fixed: Reconnect Thrashing Race Condition
Critical usability bug fix for dashboard console getting stuck in RECONNECTING/DISCONNECTED loop
Output
Fix verified and tested. The reconnect thrashing race condition no longer occurs - status bar stays stable at "Ready" after turn completion.
Quick Actions
Original Request
✅ Bug Fixed: Reconnect Thrashing Race Condition
Root Cause Analysis
When a Claude turn completed:
- Stream ended with
done === true checkForNewKontask()called immediately- Kontask not persisted yet → returns
false - State machine enters polling state
- Heartbeat keeps running,
lastEventAtnot updated - After 30s, heartbeat dispatches disconnect
- State flips between RECONNECTING ↔ DISCONNECTED
Fixes Applied
| 1. Retry loop | 5 attempts with exponential backoff (200ms → 1s) |
| 2. Heartbeat fix | Skip polling state (has its own timeout) |
| 3. lastEventAt | Update on EventSource open/events |
Files Changed
konui/src/console-streaming.ts | +25 -4 konui/src/console-ui.ts | +3 -2
Commit
b1c15b5b - Pushed to mainDetails
Type
General
Status
Completed
Scope
vibetools
Tags
bug-fixconsolestreaming
Created
7 Jan 2026, 6:45 pm
🔗 Git Commit
b1c15b5b