perf: optimize for long-running Claude sessions

Critical fixes (unbounded growth):
- Add 64KB line buffer limit with 100ms periodic flush in session.ts
- Add task tracker cleanup (max 100 completed tasks)
- Add scheduled runs auto-cleanup after 1 hour
- Fix session leaks in scheduled run iterations

High priority (performance):
- Add SSE event batching (50ms output, 100ms task updates)
- Parallelize screen stats with Promise.all()
- Add 1MB buffer limit to respawn controller

Medium priority (frontend):
- Make xterm scrollback configurable (default 5000)
- Debounce renderSessionTabs() at 100ms

New feature:
- Add CPU and memory usage display in frontend header
- New /api/system/stats endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-19 06:51:25 +01:00
co-authored by Claude Opus 4.5
parent 40fd13480d
commit 7979e77924
9 changed files with 389 additions and 19 deletions
+20
View File
@@ -187,6 +187,26 @@ body {
font-family: 'SF Mono', Monaco, monospace;
}
.header-system-stats {
display: flex;
gap: 0.75rem;
font-size: 0.7rem;
font-family: 'SF Mono', Monaco, monospace;
color: var(--text-dim);
padding: 0 0.5rem;
border-left: 1px solid var(--border);
margin-left: 0.5rem;
}
.header-system-stats span {
white-space: nowrap;
}
.header-system-stats .high {
color: var(--red);
font-weight: 500;
}
.btn-icon-header {
display: flex;
align-items: center;