Skip to content

fix(desktop): persist renderer crashes to desktop.log + ban inline render() (React #310 class) - #83535

Merged
teknium1 merged 1 commit into
mainfrom
fix/renderer-crash-class-v2
Aug 11, 2026
Merged

fix(desktop): persist renderer crashes to desktop.log + ban inline render() (React #310 class)#83535
teknium1 merged 1 commit into
mainfrom
fix/renderer-crash-class-v2

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Closes out the React #310 / lost-renderer-crash class (follow-up to #82763): renderer error-boundary crashes now survive to desktop.log with their component stack, every renderer window gets error capture (not just the main one), a lint rule prevents the #310 bug shape from ever coming back — and that rule immediately caught two live inline render() sites #82763's audit missed.

Fixes #79428.

Changes

Three layers, one class:

Console-capture/formatting logic extracted to electron/renderer-log.ts (main.ts previously inlined it) with unit tests; renderer console lines now carry the window label.

OAuth/portal windows intentionally do NOT get the capture — third-party pages can log tokens.

Validation

Result
vitest renderer-log + error-boundary + slot + pane-shell 124/124 pass
npm run typecheck (renderer + electron + e2e) pass
eslint src/ electron/ --quiet 0 errors (rule fires on the 2 missed sites before fix, clean after)
Stale-base gate 0 behind, 9-file diff, all intentional

Infographic

Renderer crash forensics

…nder() isolation class

Three-part class closure for the React #310 / lost-renderer-crash family
(#79428, follow-up to #80560 / #82763):

1. Diagnosability (#79428 defect B): error-boundary catches now persist to
   desktop.log with their component stack via a new fire-and-forget
   hermes:logs:renderer-error IPC (synchronous flush — the window may be
   dying). Every renderer-content window (main, secondary session, instance,
   HUD, quick entry, pet overlay) gets the error-level console capture that
   previously only the main window had, labeled per window. 'Open logs' on
   the crash dialog now reveals a file that actually contains the crash.

2. Recurrence guard: eslint no-restricted-syntax rule banning inline
   render() calls in JSX — the mechanism behind #80560. The rule
   immediately caught two live sites #82763's audit missed (floating
   panes, narrow-overlay reveal), both hosting plugin panes.

3. Fix those two missed sites with the same ContribRender mount.

extracted console-capture/report formatting to electron/renderer-log.ts
with unit tests; renderer console lines now carry the window label.
@teknium1
teknium1 requested a review from a team August 11, 2026 00:02
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on a129349 — fix(desktop): persist renderer crashes to desktop.log + fini

⚠️ Warnings

OSV vulnerability scan · View job

2 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


ℹ️ Info

CI-sensitive file review · View job

PR touches sensitive files, but the ci-reviewed label has been added, approving them.

Sensitive files changed:


debug info

CI timings

CI timings · View report · View job

Wall time 5m42s vs 7m8s (-20.1%). 7 job(s) slower, 7 faster, 3 unchanged.

  • JS & TS checks / apps/desktop / check:test:ui: -132.0s
  • JS & TS checks / apps/bootstrap-installer / check: -16.0s
  • JS & TS checks / ui-tui/packages/hermes-ink / check: +12.0s
  • JS & TS checks / apps/shared / check: -12.0s
  • JS & TS checks / apps/desktop / check:test:desktop:platforms: -11.0s

@teknium1 teknium1 added the ci-reviewed applied to manually approve dangerous changes label Aug 11, 2026
@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists labels Aug 11, 2026
@teknium1
teknium1 merged commit e5e2fb8 into main Aug 11, 2026
68 of 70 checks passed
@teknium1
teknium1 deleted the fix/renderer-crash-class-v2 branch August 11, 2026 00:10
teknium1 added a commit that referenced this pull request Aug 11, 2026
Reconcile the salvaged #81533 lifecycle helper with the renderer-log
console pipeline that landed in #83535 (the two PRs raced):

- window-renderer-lifecycle.ts no longer handles console-message —
  renderer-log.ts is the single owner (per-window labels, boundary
  reports). One owner means no double-logged errors on windows wearing
  both, and OAuth/portal windows (lifecycle-wired for process events)
  cannot spill third-party page console output into desktop.log.
- wake indicator window gets attachRendererConsoleCapture, keeping the
  console coverage it previously got from the helper.
- HUD window (added after the PR branched) gets log-only lifecycle
  coverage — it was the one renderer window the PR couldn't have known
  about.
- Tests updated: lifecycle helper asserts it attaches NO console-message
  listener; parser tests live in renderer-log.test.ts.
blut-agent pushed a commit to blut-agent/hermes-agent-fork that referenced this pull request Aug 11, 2026
Reconcile the salvaged NousResearch#81533 lifecycle helper with the renderer-log
console pipeline that landed in NousResearch#83535 (the two PRs raced):

- window-renderer-lifecycle.ts no longer handles console-message —
  renderer-log.ts is the single owner (per-window labels, boundary
  reports). One owner means no double-logged errors on windows wearing
  both, and OAuth/portal windows (lifecycle-wired for process events)
  cannot spill third-party page console output into desktop.log.
- wake indicator window gets attachRendererConsoleCapture, keeping the
  console coverage it previously got from the helper.
- HUD window (added after the PR branched) gets log-only lifecycle
  coverage — it was the one renderer window the PR couldn't have known
  about.
- Tests updated: lifecycle helper asserts it attaches NO console-message
  listener; parser tests live in renderer-log.test.ts.
prmartinow pushed a commit to prmartinow/hermes-agent that referenced this pull request Aug 26, 2026
Reconcile the salvaged NousResearch#81533 lifecycle helper with the renderer-log
console pipeline that landed in NousResearch#83535 (the two PRs raced):

- window-renderer-lifecycle.ts no longer handles console-message —
  renderer-log.ts is the single owner (per-window labels, boundary
  reports). One owner means no double-logged errors on windows wearing
  both, and OAuth/portal windows (lifecycle-wired for process events)
  cannot spill third-party page console output into desktop.log.
- wake indicator window gets attachRendererConsoleCapture, keeping the
  console coverage it previously got from the helper.
- HUD window (added after the PR branched) gets log-only lifecycle
  coverage — it was the one renderer window the PR couldn't have known
  about.
- Tests updated: lifecycle helper asserts it attaches NO console-message
  listener; parser tests live in renderer-log.test.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-reviewed applied to manually approve dangerous changes comp/desktop Electron desktop app (apps/desktop/*) comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Hermes Desktop 2nd-window renderer crash (React #310) — and crash dialog "Open logs" links backend log, not the renderer crash

2 participants