Skip to content

fix(desktop): recover Windows GPU sandbox 0x80000003 startup crashes (#38216) - #66803

Closed
HexLab98 wants to merge 2 commits into
NousResearch:mainfrom
HexLab98:fix/38216-windows-desktop-sandbox-crash
Closed

fix(desktop): recover Windows GPU sandbox 0x80000003 startup crashes (#38216)#66803
HexLab98 wants to merge 2 commits into
NousResearch:mainfrom
HexLab98:fix/38216-windows-desktop-sandbox-crash

Conversation

@HexLab98

@HexLab98 HexLab98 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • npx vitest run electron/windows-sandbox-fallback.test.ts (10/10)
  • On an affected Windows host (AMD RX 6000 / hybrid GPU / missing AppContainer ACE): launch Desktop from the Start Menu shortcut and confirm it stays up (first launch may recover via relaunch/marker).
  • Confirm a clean Windows host still launches without permanently forcing --no-sandbox when the boot marker clears to ok.
  • Re-run installer / hermes update and confirm icacls AppContainer grant is best-effort (install still succeeds if ACL grant fails).

@HexLab98
HexLab98 force-pushed the fix/38216-windows-desktop-sandbox-crash branch from a85b161 to 093da63 Compare July 18, 2026 07:48
HexLab98 added 2 commits July 18, 2026 14:48
Grant ALL APPLICATION PACKAGES RX on the unpacked app and stick a boot
marker so fatal Chromium sandbox deaths relaunch with --no-sandbox
(NousResearch#38216).
@HexLab98
HexLab98 force-pushed the fix/38216-windows-desktop-sandbox-crash branch from 093da63 to 8896937 Compare July 18, 2026 07:48
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/desktop Electron desktop app (apps/desktop/*) platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows needs-decision Awaiting maintainer decision before any implementation labels Jul 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #38216. This is a competing recovery design alongside #45341: it repairs AppContainer ACLs and uses a marker-based one-shot --no-sandbox fallback, rather than only changing GPU switches. Maintainer choice is needed.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed by Hermes Agent

teknium1 added a commit that referenced this pull request Jul 18, 2026
…sandbox loss

Follow-up to the salvaged #66803 (@HexLab98):

- Two-strike boot marker: a single mid-boot abort (task-manager kill,
  power loss) no longer disables the sandbox — only a second consecutive
  abort, or a signature-confirmed GPU/renderer STATUS_BREAKPOINT death,
  engages --no-sandbox.
- Version-scoped stickiness: the fallback marker records the app version
  and re-probes the sandbox once after an update (new Electron or
  installer ACL repair may have fixed the host) instead of degrading
  forever. A failed re-probe returns straight to fallback.
- Launch-time icacls repair now runs only when the marker shows a prior
  aborted boot (icacls /T recurses the whole install tree — healthy
  launches skip it; the installer grants the ACE at install time), and
  targets the install dir only. The userData grant is dropped: granting
  S-1-15-2-2 RX on userData would expose Hermes sessions/config to every
  AppContainer app on the machine.
- Renderer crash-loop recovery (same class as #56726, credit @Sahil-SS9
  in PR #57414): a Windows renderer crash loop bearing the breakpoint
  exit code gets the same one-shot --no-sandbox relaunch instead of a
  dead window; unrelated crash loops keep the sandbox.
- Manual --no-sandbox launches are honored but never made sticky.

Tests: 15/15 windows-sandbox-fallback vitest; full desktop electron
suite 432 passed / 1 skipped.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #66842 (#66842), rebase-merged so both of your commits landed on main with your authorship preserved in git log — thanks for the thorough work here, the injectable helper-module design and the test coverage made this a clean salvage.

On top of your base we added a hardening commit addressing review findings:

  • Two-strike boot marker (a single mid-boot abort — task-manager kill, power loss — no longer disables the sandbox; only a second consecutive abort or a signature-confirmed breakpoint death engages the fallback)
  • Version-scoped stickiness: the fallback re-probes the sandbox once after each app update instead of persisting forever
  • Launch-time icacls repair now runs only after an aborted boot and targets the install dir only (the userData grant would have exposed Hermes sessions/config to every AppContainer app)
  • Renderer crash-loop recovery gated on the 0x80000003 signature (credit also to @Sahil-SS9, who first shipped the Windows renderer-relaunch shape in fix(desktop): persist zoom to JSON, save window state on show, auto-relaunch --no-sandbox on Windows crash loop #57414)

Fixes #38216. Closing this PR in favor of the merged salvage. Thanks again!

@teknium1 teknium1 closed this Jul 18, 2026
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…sandbox loss

Follow-up to the salvaged NousResearch#66803 (@HexLab98):

- Two-strike boot marker: a single mid-boot abort (task-manager kill,
  power loss) no longer disables the sandbox — only a second consecutive
  abort, or a signature-confirmed GPU/renderer STATUS_BREAKPOINT death,
  engages --no-sandbox.
- Version-scoped stickiness: the fallback marker records the app version
  and re-probes the sandbox once after an update (new Electron or
  installer ACL repair may have fixed the host) instead of degrading
  forever. A failed re-probe returns straight to fallback.
- Launch-time icacls repair now runs only when the marker shows a prior
  aborted boot (icacls /T recurses the whole install tree — healthy
  launches skip it; the installer grants the ACE at install time), and
  targets the install dir only. The userData grant is dropped: granting
  S-1-15-2-2 RX on userData would expose Hermes sessions/config to every
  AppContainer app on the machine.
- Renderer crash-loop recovery (same class as NousResearch#56726, credit @Sahil-SS9
  in PR NousResearch#57414): a Windows renderer crash loop bearing the breakpoint
  exit code gets the same one-shot --no-sandbox relaunch instead of a
  dead window; unrelated crash loops keep the sandbox.
- Manual --no-sandbox launches are honored but never made sticky.

Tests: 15/15 windows-sandbox-fallback vitest; full desktop electron
suite 432 passed / 1 skipped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) needs-decision Awaiting maintainer decision before any implementation P1 High — major feature broken, no workaround platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Hermes Desktop v40.9.3 crashes on startup on Windows 11 — 0x80000003 breakpoint exception at consistent offset

4 participants