← Back to Kontasks
WebSocket Broadcast Phases 3-5 Complete
Implemented kontask broadcasts, force logout tool, and service restart broadcasts
Output
✅ WebSocket Broadcast Enhancement Complete
All 5 Phases Implemented
| ✓ Phase 1 | Notification dropdown UI + localStorage | Done |
| ✓ Phase 2 | Login/logout broadcasts | Done |
| ✓ Phase 3 | Kontask created/updated broadcasts | Done |
| ✓ Phase 4 | Force logout MCP tool | Done |
| ✓ Phase 5 | Service restart broadcasts | Done |
📋 Phase 3: Kontask Broadcasts
kontask_created- Notifies when new kontask is createdkontask_updated- Notifies when kontask status changes- Only shows notification if you're the target user or it's general
- Notification links directly to the kontask
🚨 Phase 4: Force Logout
New MCP tool for emergency logout of all non-admin users:
mcp__konui__konui_force_logout
{
"reason": "Security update - please log in again",
"exceptRoles": ["admin"] // optional, defaults to ["admin"]
}
Behavior:
- Admins see warning notification but stay logged in
- Non-admins get logged out after 2s delay, redirected to /login
- Reason shown on login page
🔄 Phase 5: Service Restart Broadcasts
- New endpoint:
POST /api/admin/service-restart - MCP
konui_restart_servicenow broadcasts before restarting - All connected clients see warning notification with service name and who initiated
🔔 Full Event Type Summary
| Event | Trigger | Notification |
|---|---|---|
| user_login | POST /api/login | 👤 {user} signed in |
| user_logout | POST /api/logout | 👋 {user} signed out |
| kontask_created | POST /api/kontasks | 📋 New: {title} |
| kontask_updated | PATCH /api/kontasks/:id | 📋 {title} → {status} |
| account_switch | Claude account change | 🔄 Switched to {account} |
| service_restart | MCP restart tool | 🔄 {service} restarting |
| force_logout | MCP force_logout | 🚨 Logout + redirect |
| system_alert | Manual broadcast | Custom message |
Commit: 602a1610
Konui restarted - All broadcasts now live
What's Next?
Test the notifications:
Quick Actions
Original Request
No layout configured
Details
Type
General
Status
Completed
Scope
vibetools
Tags
websocketnotificationsmcp
Created
8 Jan 2026, 10:32 am
Updated
8 Jan 2026, 10:32 am
Created By
claude
Raw Data
{
"id": "f91c3b64-296d-4a80-9130-810d614781dd",
"type": "general",
"status": "completed",
"title": "WebSocket Broadcast Phases 3-5 Complete",
"description": "Implemented kontask broadcasts, force logout tool, and service restart broadcasts",
"context": {
"output": "<div style=\"background:#1e1e1e;color:#e0e0e0;padding:20px;border-radius:8px;font-family:'Segoe UI',sans-serif;\">\n<h2 style=\"color:#fff;margin:0 0 16px 0;\">✅ WebSocket Broadcast Enhancement Complete</h2>\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 12px 0;\">All 5 Phases Implemented</h3>\n<table style=\"width:100%;border-collapse:collapse;\">\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">✓</span> Phase 1</td>\n<td style=\"padding:8px;\">Notification dropdown UI + localStorage</td>\n<td style=\"padding:8px;color:#22c55e;\">Done</td>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">✓</span> Phase 2</td>\n<td style=\"padding:8px;\">Login/logout broadcasts</td>\n<td style=\"padding:8px;color:#22c55e;\">Done</td>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">✓</span> Phase 3</td>\n<td style=\"padding:8px;\">Kontask created/updated broadcasts</td>\n<td style=\"padding:8px;color:#22c55e;\">Done</td>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">✓</span> Phase 4</td>\n<td style=\"padding:8px;\">Force logout MCP tool</td>\n<td style=\"padding:8px;color:#22c55e;\">Done</td>\n</tr>\n<tr>\n<td style=\"padding:8px;\"><span style=\"color:#22c55e;\">✓</span> Phase 5</td>\n<td style=\"padding:8px;\">Service restart broadcasts</td>\n<td style=\"padding:8px;color:#22c55e;\">Done</td>\n</tr>\n</table>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#3b82f6;margin:0 0 12px 0;\">📋 Phase 3: Kontask Broadcasts</h3>\n<ul style=\"margin:0;padding-left:20px;line-height:1.8;\">\n<li><code style=\"background:#1e1e1e;padding:2px 6px;border-radius:4px;\">kontask_created</code> - Notifies when new kontask is created</li>\n<li><code style=\"background:#1e1e1e;padding:2px 6px;border-radius:4px;\">kontask_updated</code> - Notifies when kontask status changes</li>\n<li>Only shows notification if you're the target user or it's general</li>\n<li>Notification links directly to the kontask</li>\n</ul>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#ef4444;margin:0 0 12px 0;\">🚨 Phase 4: Force Logout</h3>\n<p style=\"color:#9ca3af;margin:0 0 12px 0;\">New MCP tool for emergency logout of all non-admin users:</p>\n<div style=\"background:#1e1e1e;padding:12px;border-radius:6px;font-family:monospace;\">\n<span style=\"color:#c678dd;\">mcp__konui__konui_force_logout</span>\n<pre style=\"margin:8px 0 0 0;color:#98c379;\">{\n \"reason\": \"Security update - please log in again\",\n \"exceptRoles\": [\"admin\"] // optional, defaults to [\"admin\"]\n}</pre>\n</div>\n<p style=\"color:#9ca3af;margin:12px 0 0 0;\"><strong>Behavior:</strong></p>\n<ul style=\"color:#9ca3af;margin:8px 0 0 0;padding-left:20px;\">\n<li>Admins see warning notification but stay logged in</li>\n<li>Non-admins get logged out after 2s delay, redirected to /login</li>\n<li>Reason shown on login page</li>\n</ul>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#f59e0b;margin:0 0 12px 0;\">🔄 Phase 5: Service Restart Broadcasts</h3>\n<ul style=\"margin:0;padding-left:20px;line-height:1.8;color:#9ca3af;\">\n<li>New endpoint: <code style=\"background:#1e1e1e;padding:2px 6px;border-radius:4px;\">POST /api/admin/service-restart</code></li>\n<li>MCP <code style=\"background:#1e1e1e;padding:2px 6px;border-radius:4px;\">konui_restart_service</code> now broadcasts before restarting</li>\n<li>All connected clients see warning notification with service name and who initiated</li>\n</ul>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#fff;margin:0 0 12px 0;\">🔔 Full Event Type Summary</h3>\n<table style=\"width:100%;border-collapse:collapse;font-size:0.9rem;\">\n<tr style=\"border-bottom:1px solid #4b5563;\">\n<th style=\"text-align:left;padding:8px;color:#fff;\">Event</th>\n<th style=\"text-align:left;padding:8px;color:#fff;\">Trigger</th>\n<th style=\"text-align:left;padding:8px;color:#fff;\">Notification</th>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;color:#22c55e;\">user_login</td>\n<td style=\"padding:8px;\">POST /api/login</td>\n<td style=\"padding:8px;\">👤 {user} signed in</td>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;color:#f59e0b;\">user_logout</td>\n<td style=\"padding:8px;\">POST /api/logout</td>\n<td style=\"padding:8px;\">👋 {user} signed out</td>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;color:#3b82f6;\">kontask_created</td>\n<td style=\"padding:8px;\">POST /api/kontasks</td>\n<td style=\"padding:8px;\">📋 New: {title}</td>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;color:#8b5cf6;\">kontask_updated</td>\n<td style=\"padding:8px;\">PATCH /api/kontasks/:id</td>\n<td style=\"padding:8px;\">📋 {title} → {status}</td>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;color:#06b6d4;\">account_switch</td>\n<td style=\"padding:8px;\">Claude account change</td>\n<td style=\"padding:8px;\">🔄 Switched to {account}</td>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;color:#f59e0b;\">service_restart</td>\n<td style=\"padding:8px;\">MCP restart tool</td>\n<td style=\"padding:8px;\">🔄 {service} restarting</td>\n</tr>\n<tr style=\"border-bottom:1px solid #3b3b3b;\">\n<td style=\"padding:8px;color:#ef4444;\">force_logout</td>\n<td style=\"padding:8px;\">MCP force_logout</td>\n<td style=\"padding:8px;\">🚨 Logout + redirect</td>\n</tr>\n<tr>\n<td style=\"padding:8px;color:#ec4899;\">system_alert</td>\n<td style=\"padding:8px;\">Manual broadcast</td>\n<td style=\"padding:8px;\">Custom message</td>\n</tr>\n</table>\n</div>\n\n<div style=\"background:#1e3a5f;border:1px solid #3b82f6;padding:16px;border-radius:6px;\">\n<p style=\"margin:0;color:#9ca3af;\"><strong>Commit:</strong> <code style=\"background:#1e1e1e;padding:2px 6px;border-radius:4px;\">602a1610</code></p>\n<p style=\"margin:8px 0 0 0;color:#9ca3af;\"><strong>Konui restarted</strong> - All broadcasts now live</p>\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;\">Test the notifications:</p>\n</div>\n</div>",
"requestedAt": "2026-01-08T00:30:00.000Z",
"requestId": "7d82cf2f-df4f-402e-a9bc-231a410ba72f",
"choices": [
{
"label": "Test login/logout",
"value": "Log stephanie in/out in another browser to test the login/logout notifications",
"primary": true
},
{
"label": "Test force logout",
"value": "Use the konui_force_logout MCP tool to test forcing all non-admin users to log out"
},
{
"label": "View all commits",
"value": "Show me all the WebSocket broadcast commits made today"
}
]
},
"createdBy": "claude",
"createdAt": "2026-01-08T00:32:47.549Z",
"updatedAt": "2026-01-08T00:32:48.008Z",
"requestId": "7d82cf2f-df4f-402e-a9bc-231a410ba72f",
"scope": "vibetools",
"tags": [
"websocket",
"notifications",
"mcp"
],
"targetUser": "claude"
}