Optimize Console performance and reduce unnecessary logging
From the lag analysis in Task 13902 (report attached, items 6-10).
1. **Chunk loads after wake.** After the laptop wakes, the first dynamic `import()` hung for 27-94 s on a dead HTTP/2 connection before failing. The retry then loaded in under 1 s. Race each attempt in `loadWithRetry` (apps/web/src/lib/lazyRetry.ts) against a ~8 s timer, and/or prefetch route chunks while idle.
2. **Hidden-tab stalls.** Don't report `stall` events from hidden tabs (apps/web/src/net/stall.ts). They inflate the numbers.
3. **Stale tabs.** One tab ran a build 314 versions old for 8 h. When `/version.json` changes and the tab is idle, offer or perform a reload.
4. **Page polling.** Reduce per-page polling (tasks/N, tasks/tree, health/components, tasks, trial-agents, inbox, worktrees, access/requests). Poll only the visible panel, or move these onto `/api/stream` pushes.
5. **Repeating warnings.** Log `slot-stack: node ... reports a tailnet name that is not a DNS name` (37.5 k per day) and `alarm ... is open as Task N` (4.3 k per day) once per change, not on every tick.
6. **Bogus timing field.** In apps/web/src/lib/resourceTiming.ts, `span()` must require `start > 0`. Today `download_ms` reports the page's age when `responseStart` is 0.
Out of scope: server autoscaling, node polling, relay racing.
Done means:
- Unit tests cover the chunk timeout and retry, hidden-tab stall suppression, and `span()` with `start = 0`.
- On dev, a task page makes measurably fewer requests per minute (before/after count).
- The two warnings appear at most once per state change in dev logs.
- A visual check of the stale-tab prompt at desktop and ≤480 px.
Outcome
Attachments
Activity
- Created
- Updated
- Run
- Runner started
- Awaiting response
- Awaiting response
- Runner resumed