mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 00:02:56 +00:00
A renderer main-thread freeze (one long synchronous task) stops the renderer's own `renderer_memory` heartbeat, so a runaway allocation up to the V8 limit lands as a silent multi-minute gap before `render-process-gone`. The renderer cannot report on a freeze because the freeze is what stops it from reporting. Add a main-process watchdog that, on Electron's BrowserWindow `unresponsive`, records a `renderer_unresponsive` breadcrumb and starts a 30s sampler writing the frozen renderer's own working set / private bytes (pid-filtered via `getAppMetrics`) as `renderer_unresponsive_sample` breadcrumbs, capped at 20; on `responsive` it records a duration/peak summary. The next occurrence of the runaway-freeze signature seen repeatedly in #orca-crashes (renderer climbs to ~3.96 GB private over ~5 min while the JS heap stays flat) then arrives with its allocation curve on record instead of a gap. Diagnostic only: no user-facing behavior change, no crash fixed directly, no new wire/IPC surface. Re-arm across an in-place recovery reload is keyed on `(pid, creationTime)` renderer identity (mirroring process-gone-diagnostics.ts) so a reloaded renderer that reuses the dead pid is still recognized as a new generation. Five adversarial review loops; loop 5 clean.