add sidebar footer RSS readout (polls /memory every 30s)

Footer now shows "<bun-rss> · <tab-count>" sourced from the /memory
endpoint, polled every 30s. Color thresholds: orange warn at 2 GB Bun
RSS or 50 tabs; red bad at 8 GB or 200 tabs (matches the tab-guardrail
threshold landing in a later commit). The footer gives the user an
early signal that the cliff is forming, instead of only learning when
the OS OOM-kills the process.

Backoff per Codex's flag: if a poll takes > 2s response time the
sidebar drops to a 5-minute cadence until the next successful fast
poll. The diagnostic shouldn't add load to a browser that's already
unhealthy.

Start/stop is wired to the existing setServerInfo() hook so the timer
only runs while the sidebar is connected to a server.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-05-27 07:30:07 -07:00
parent 10495978e6
commit 98b2ae8103
3 changed files with 114 additions and 0 deletions
+15
View File
@@ -1137,6 +1137,21 @@ footer {
transition: color 150ms;
}
.footer-port:hover { color: var(--text-label); }
.footer-mem {
color: var(--text-meta);
font-family: var(--font-mono);
font-size: 11px;
margin-right: 6px;
padding: 1px 6px;
border-radius: var(--radius-sm);
transition: color 150ms;
}
.footer-mem.warn {
color: #f59e0b;
}
.footer-mem.bad {
color: #ef4444;
}
.port-input {
width: 56px;
padding: 2px 6px;