App: replace a silent socket instead of hanging; blink the terminal cursor on a timer; keep one markdown cache entry per streamed reply

A socket that outlived a sleep or network change looked open, so every
queued request waited its own 30 s timeout behind the last until the page
was reopened. The client now replaces a socket whose request times out
unheard (or after two timeouts in a row), and probes it with a ping after
a quiet spell or on returning to the foreground.

The terminal's blinking cursor ran a Ticker (a frame every vsync); a 530 ms
timer now flips it. Streamed deltas no longer flood the markdown cache and
evict finished answers.

Adds tool/perf/idle_session_bench.mjs (idle frames, long-session heap,
snapshot census) and notes/perf-hangs-idle.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 20:47:22 +00:00
parent 23d8658e80
commit 2889d59119
17 changed files with 589 additions and 47 deletions
+3
View File
@@ -637,6 +637,9 @@ class _PipelinesAppState extends State<PipelinesApp>
return;
}
if (connection != ConnectionKind.connected) return;
// A socket that looks open may have died while the app was away (a
// laptop's sleep): a ping that hears nothing replaces it.
_session.client.probe();
// Foreground return refreshes the visible Runs list and selected detail.
// Pipeline definitions retain their current data while being inspected.