← Back to Kontasks
Dashboard stuck in RECONNECTING - root cause found
Found the bug: state machine not notified when recovery finds existing kontask
Output
Bug Found: RECONNECTING Stuck State
Root Cause
When recovery finds an existing kontask card, it sets state.recoveryComplete = true but never dispatches to the state machine to transition to idle!
The Bug Location
/konnectvol/konui/src/console-init.ts lines 61-62:
// When kontask card already present: state.recoveryComplete = true; // ✓ Correct clearPendingState(); // ✓ Correct // ✗ MISSING: dispatch to state machine!
Why It Happens
- You leave dashboard while Claude is working
- Claude finishes and creates kontask
- You return to dashboard
restoreHistory()displays the kontask card- Init code sees card exists, sets
recoveryComplete = true - But state machine still shows "RECONNECTING"
- Only "Stop" button forces state transition to idle
The Fix
Add dispatch({ type: 'kontask_found', kontaskId: 'already-displayed' }) when recovery finds the kontask already displayed:
// Line 61-62 in console-init.ts if (existingCard) { log('info', 'init', 'Correct kontask card already present', ...); state.recoveryComplete = true; clearPendingState(); dispatch({ type: 'kontask_found', kontaskId: 'already-displayed' }); // ← ADD THIS }
Same Issue in console-history.ts
Lines 205, 418, 439 call clearPendingState() without dispatching. Should also be fixed:
- Line 205: After matching kontext → add dispatch
- Line 418: After fallback finds kontask → add dispatch
- Line 439: After clearing stale state → add dispatch
What's Next?
Choose an action:
Quick Actions
Original Request
No layout configured
Details
Type
General
Status
Completed
Scope
vibetools
Tags
consolebugstate-machine
Created
3 Jan 2026, 8:59 am
Updated
3 Jan 2026, 8:59 am
Created By
claude
Raw Data
{
"id": "0bfff374-6e0f-4ef7-8430-aae02e2d7b11",
"type": "general",
"status": "completed",
"title": "Dashboard stuck in RECONNECTING - root cause found",
"description": "Found the bug: state machine not notified when recovery finds existing kontask",
"context": {
"output": "<div style=\"background:#1e1e1e;color:#e0e0e0;padding:20px;border-radius:8px;font-family:system-ui,-apple-system,sans-serif;\">\n<h2 style=\"color:#fff;margin:0 0 16px 0;\">Bug Found: RECONNECTING Stuck State</h2>\n\n<div style=\"background:#3a1a1a;border:1px solid #f87171;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#f87171;margin:0 0 8px 0;\">Root Cause</h3>\n<p style=\"margin:0;line-height:1.6;\">When recovery finds an existing kontask card, it sets <code style=\"background:#2d2d2d;padding:2px 6px;border-radius:3px;\">state.recoveryComplete = true</code> but <strong>never dispatches to the state machine</strong> to transition to idle!</p>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#61afef;margin:0 0 12px 0;\">The Bug Location</h3>\n<p style=\"margin:0 0 8px 0;\"><code style=\"background:#1a1a1a;padding:2px 6px;border-radius:3px;\">/konnectvol/konui/src/console-init.ts</code> lines 61-62:</p>\n<pre style=\"background:#1a1a1a;padding:12px;border-radius:4px;overflow-x:auto;line-height:1.5;font-size:0.85rem;\"><span style=\"color:#7f848e;\">// When kontask card already present:</span>\nstate.recoveryComplete = <span style=\"color:#56b6c2;\">true</span>; <span style=\"color:#7f848e;\">// ✓ Correct</span>\nclearPendingState(); <span style=\"color:#7f848e;\">// ✓ Correct</span>\n<span style=\"color:#f87171;\">// ✗ MISSING: dispatch to state machine!</span></pre>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#c678dd;margin:0 0 12px 0;\">Why It Happens</h3>\n<ol style=\"margin:0;padding-left:20px;line-height:1.8;\">\n<li>You leave dashboard while Claude is working</li>\n<li>Claude finishes and creates kontask</li>\n<li>You return to dashboard</li>\n<li><code style=\"background:#1a1a1a;padding:2px 6px;border-radius:3px;\">restoreHistory()</code> displays the kontask card</li>\n<li>Init code sees card exists, sets <code style=\"background:#1a1a1a;padding:2px 6px;border-radius:3px;\">recoveryComplete = true</code></li>\n<li><span style=\"color:#f87171;\">But state machine still shows \"RECONNECTING\"</span></li>\n<li>Only \"Stop\" button forces state transition to idle</li>\n</ol>\n</div>\n\n<div style=\"background:#1a3a1a;border:1px solid #22c55e;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#22c55e;margin:0 0 8px 0;\">The Fix</h3>\n<p style=\"margin:0 0 12px 0;\">Add <code style=\"background:#2d2d2d;padding:2px 6px;border-radius:3px;\">dispatch({ type: 'kontask_found', kontaskId: 'already-displayed' })</code> when recovery finds the kontask already displayed:</p>\n<pre style=\"background:#1a1a1a;padding:12px;border-radius:4px;overflow-x:auto;line-height:1.5;font-size:0.85rem;\"><span style=\"color:#7f848e;\">// Line 61-62 in console-init.ts</span>\n<span style=\"color:#c678dd;\">if</span> (existingCard) {\n log(<span style=\"color:#98c379;\">'info'</span>, <span style=\"color:#98c379;\">'init'</span>, <span style=\"color:#98c379;\">'Correct kontask card already present'</span>, ...);\n state.recoveryComplete = <span style=\"color:#56b6c2;\">true</span>;\n clearPendingState();\n <span style=\"color:#22c55e;\">dispatch({ type: 'kontask_found', kontaskId: 'already-displayed' });</span> <span style=\"color:#7f848e;\">// ← ADD THIS</span>\n}</pre>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#e5c07b;margin:0 0 12px 0;\">Same Issue in console-history.ts</h3>\n<p style=\"margin:0 0 8px 0;\">Lines 205, 418, 439 call <code style=\"background:#1a1a1a;padding:2px 6px;border-radius:3px;\">clearPendingState()</code> without dispatching. Should also be fixed:</p>\n<ul style=\"margin:8px 0 0 0;padding-left:20px;line-height:1.8;\">\n<li>Line 205: After matching kontext → add dispatch</li>\n<li>Line 418: After fallback finds kontask → add dispatch</li>\n<li>Line 439: After clearing stale state → add dispatch</li>\n</ul>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-top:16px;\">\n<h4 style=\"margin:0 0 8px 0;color:#fff;\">What's Next?</h4>\n<p style=\"color:#9ca3af;margin:0;\">Choose an action:</p>\n</div>\n</div>",
"choices": [
{
"label": "Apply the fix",
"value": "Apply the fix to console-init.ts and console-history.ts - add dispatch calls when recovery completes",
"primary": true
},
{
"label": "Show me the diff",
"value": "Show me exactly what code changes are needed to fix this bug"
},
{
"label": "Test first",
"value": "Before fixing, help me reproduce this bug reliably"
}
],
"requestedAt": "2026-01-03T10:30:00Z",
"requestId": "6c952c82-c7a4-469c-b6f6-43f14032880e"
},
"createdBy": "claude",
"createdAt": "2026-01-02T22:59:59.675Z",
"updatedAt": "2026-01-02T22:59:59.824Z",
"requestId": "6c952c82-c7a4-469c-b6f6-43f14032880e",
"scope": "vibetools",
"tags": [
"console",
"bug",
"state-machine"
],
"targetUser": "claude"
}