← Back to Kontasks
Konsole Safety Limits & Metrics Implemented
Added hard timeout, tool call limits, and full server metrics tracking
Output
✓ Konsole Safety Limits & Metrics Implemented
1. Safety Limits (Prevent Runaway Processes)
| Feature | Default | Env Variable |
|---|---|---|
| Hard Max Turn Time | 15 minutes | KONSOLE_MAX_TURN_TIME_MS |
| Max Tool Calls Per Turn | 200 calls | KONSOLE_MAX_TOOL_CALLS_PER_TURN |
How it works: The hard timeout cannot be reset by activity. Even if Claude is constantly calling tools (which previously reset the idle timeout), it will be stopped after 15 minutes. The tool call limit stops Claude after 200 tool calls in a single turn.
2. Server Metrics Tracking
New /konnectvol/konsole/src/metrics.ts module tracks:
| Metric | Description |
|---|---|
| CPU | Usage %, Load average (1m, 5m, 15m) |
| Memory | Total, Used, Free, Buffers/Cache (MB) |
| Disk | Total, Used, Free (GB) for working dir |
| Process | Uptime, Heap usage, Active sessions |
3. Multi-Server Support
Each server has a unique serverId for when konsole/konui run on different machines:
# Auto-detected from hostname, or set explicitly: KONSOLE_SERVER_ID="kon-prod-1"
Metrics are stored per-server in metrics-{serverId}.jsonl
4. GET /metrics API
Enhanced metrics endpoint:
# Current metrics curl http://localhost:8020/metrics # With history (last N snapshots) curl http://localhost:8020/metrics?history=50 # With aggregates (1h, 24h, 7d) curl http://localhost:8020/metrics?aggregate=24h
Files Changed
konsole/src/config.ts # +maxTurnTimeMs, +maxToolCallsPerTurn, +serverId konsole/src/stream.ts # +hardTimeout, +checkToolCallLimit() konsole/src/metrics.ts # NEW: CPU/RAM/disk collection konsole/src/main.ts # Start metrics on boot, enhanced /metrics konsole/src/types.ts # +metrics, +statusline log categories konsole/tests/config.test.ts # Updated for new config fields
✓ All 7 test suites pass (162 steps)
What's Next?
Konsole needs to be restarted for changes to take effect.
Quick Actions
Original Request
No layout configured
Details
Type
General
Status
Completed
Scope
vibetools
Tags
konsoleperformancestabilitymetrics
Created
5 Jan 2026, 9:35 am
Updated
5 Jan 2026, 9:35 am
Timing
⏱️ 338.9s
41 tools
● TTFE 1%
● Thinking 94%
● Tools 5%
Created By
claude
Raw Data
{
"id": "20ee5645-48f5-4cc3-bc28-b9ddb7d0c436",
"type": "general",
"status": "completed",
"title": "Konsole Safety Limits & Metrics Implemented",
"description": "Added hard timeout, tool call limits, and full server metrics tracking",
"context": {
"output": "<div style=\"background:#1e1e1e;color:#e0e0e0;padding:20px;border-radius:8px;font-family:sans-serif;\"><h2 style=\"color:#fff;margin:0 0 16px 0;\">✓ Konsole Safety Limits & Metrics Implemented</h2><div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\"><h3 style=\"color:#98c379;margin:0 0 12px 0;\">1. Safety Limits (Prevent Runaway Processes)</h3><table style=\"width:100%;border-collapse:collapse;\"><tr><th style=\"text-align:left;padding:8px;border-bottom:1px solid #444;color:#9ca3af;\">Feature</th><th style=\"text-align:left;padding:8px;border-bottom:1px solid #444;color:#9ca3af;\">Default</th><th style=\"text-align:left;padding:8px;border-bottom:1px solid #444;color:#9ca3af;\">Env Variable</th></tr><tr><td style=\"padding:8px;color:#e5c07b;\">Hard Max Turn Time</td><td style=\"padding:8px;color:#98c379;\">15 minutes</td><td style=\"padding:8px;font-family:monospace;color:#61afef;\">KONSOLE_MAX_TURN_TIME_MS</td></tr><tr><td style=\"padding:8px;color:#e5c07b;\">Max Tool Calls Per Turn</td><td style=\"padding:8px;color:#98c379;\">200 calls</td><td style=\"padding:8px;font-family:monospace;color:#61afef;\">KONSOLE_MAX_TOOL_CALLS_PER_TURN</td></tr></table><p style=\"margin:12px 0 0 0;color:#9ca3af;\"><strong>How it works:</strong> The hard timeout <em>cannot</em> be reset by activity. Even if Claude is constantly calling tools (which previously reset the idle timeout), it will be stopped after 15 minutes. The tool call limit stops Claude after 200 tool calls in a single turn.</p></div><div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\"><h3 style=\"color:#61afef;margin:0 0 12px 0;\">2. Server Metrics Tracking</h3><p style=\"margin:0 0 12px 0;\">New <code style=\"background:#1e1e1e;padding:2px 6px;border-radius:4px;\">/konnectvol/konsole/src/metrics.ts</code> module tracks:</p><table style=\"width:100%;border-collapse:collapse;\"><tr><th style=\"text-align:left;padding:8px;border-bottom:1px solid #444;color:#9ca3af;\">Metric</th><th style=\"text-align:left;padding:8px;border-bottom:1px solid #444;color:#9ca3af;\">Description</th></tr><tr><td style=\"padding:8px;color:#e5c07b;\">CPU</td><td style=\"padding:8px;\">Usage %, Load average (1m, 5m, 15m)</td></tr><tr><td style=\"padding:8px;color:#e5c07b;\">Memory</td><td style=\"padding:8px;\">Total, Used, Free, Buffers/Cache (MB)</td></tr><tr><td style=\"padding:8px;color:#e5c07b;\">Disk</td><td style=\"padding:8px;\">Total, Used, Free (GB) for working dir</td></tr><tr><td style=\"padding:8px;color:#e5c07b;\">Process</td><td style=\"padding:8px;\">Uptime, Heap usage, Active sessions</td></tr></table></div><div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\"><h3 style=\"color:#c678dd;margin:0 0 12px 0;\">3. Multi-Server Support</h3><p style=\"margin:0 0 8px 0;\">Each server has a unique <code style=\"background:#1e1e1e;padding:2px 6px;border-radius:4px;\">serverId</code> for when konsole/konui run on different machines:</p><pre style=\"background:#1e1e1e;padding:12px;border-radius:4px;overflow-x:auto;margin:0;\"><span style=\"color:#7f848e;\"># Auto-detected from hostname, or set explicitly:</span>\n<span style=\"color:#61afef;\">KONSOLE_SERVER_ID</span>=<span style=\"color:#98c379;\">\"kon-prod-1\"</span></pre><p style=\"margin:12px 0 0 0;color:#9ca3af;\">Metrics are stored per-server in <code style=\"background:#1e1e1e;padding:2px 6px;border-radius:4px;\">metrics-{serverId}.jsonl</code></p></div><div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\"><h3 style=\"color:#56b6c2;margin:0 0 12px 0;\">4. GET /metrics API</h3><p style=\"margin:0 0 8px 0;\">Enhanced metrics endpoint:</p><pre style=\"background:#1e1e1e;padding:12px;border-radius:4px;overflow-x:auto;margin:0;font-size:0.9rem;\"><span style=\"color:#7f848e;\"># Current metrics</span>\ncurl http://localhost:8020/metrics\n\n<span style=\"color:#7f848e;\"># With history (last N snapshots)</span>\ncurl http://localhost:8020/metrics?history=50\n\n<span style=\"color:#7f848e;\"># With aggregates (1h, 24h, 7d)</span>\ncurl http://localhost:8020/metrics?aggregate=24h</pre></div><div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\"><h3 style=\"color:#f97316;margin:0 0 12px 0;\">Files Changed</h3><pre style=\"background:#1e1e1e;padding:12px;border-radius:4px;overflow-x:auto;margin:0;line-height:1.6;\"><span style=\"color:#98c379;\">konsole/src/config.ts</span> <span style=\"color:#7f848e;\"># +maxTurnTimeMs, +maxToolCallsPerTurn, +serverId</span>\n<span style=\"color:#98c379;\">konsole/src/stream.ts</span> <span style=\"color:#7f848e;\"># +hardTimeout, +checkToolCallLimit()</span>\n<span style=\"color:#98c379;\">konsole/src/metrics.ts</span> <span style=\"color:#7f848e;\"># NEW: CPU/RAM/disk collection</span>\n<span style=\"color:#98c379;\">konsole/src/main.ts</span> <span style=\"color:#7f848e;\"># Start metrics on boot, enhanced /metrics</span>\n<span style=\"color:#98c379;\">konsole/src/types.ts</span> <span style=\"color:#7f848e;\"># +metrics, +statusline log categories</span>\n<span style=\"color:#98c379;\">konsole/tests/config.test.ts</span> <span style=\"color:#7f848e;\"># Updated for new config fields</span></pre></div><div style=\"background:#2d2d2d;padding:12px;border-radius:6px;margin-top:16px;border-left:4px solid #98c379;\"><p style=\"margin:0;color:#98c379;\"><strong>✓ All 7 test suites pass (162 steps)</strong></p></div><div style=\"background:#2d2d2d;padding:12px;border-radius:6px;margin-top:12px;\"><h4 style=\"margin:0 0 8px 0;color:#fff;\">What's Next?</h4><p style=\"color:#9ca3af;margin:0;\">Konsole needs to be restarted for changes to take effect.</p></div></div>",
"requestedAt": "2026-01-05T09:35:00.000Z",
"requestId": "8ba267db-ce56-4af3-b30d-abc7047488df",
"choices": [
{
"label": "Restart konsole",
"value": "Restart konsole to apply the new safety limits and metrics tracking",
"primary": true
},
{
"label": "Commit changes",
"value": "Commit all the konsole safety and metrics changes to git"
},
{
"label": "Test metrics API",
"value": "Test the new /metrics API endpoint to see CPU, RAM, and disk stats"
}
],
"turnTiming": {
"totalMs": 338939,
"ttfeMs": 3863,
"thinkingMs": 317616,
"toolExecutionMs": 17459,
"toolCallCount": 41,
"thinkingPct": 94,
"toolsPct": 5,
"ttfePct": 1
}
},
"createdBy": "claude",
"createdAt": "2026-01-04T23:35:31.900Z",
"updatedAt": "2026-01-04T23:35:39.723Z",
"requestId": "8ba267db-ce56-4af3-b30d-abc7047488df",
"scope": "vibetools",
"tags": [
"konsole",
"performance",
"stability",
"metrics"
],
"targetUser": "claude"
}