Repository navigation
fix(desktop): recover from socket and renderer crashes - #4207
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Test evidence — desktop crash resilienceExact PR head: Embedded Electron socket Type-of-Service containment — 0/0 screenshots · 1 assertion✅ 1 expectation passed · 0 failed · 0 pending
ℹ️ ASSERTION — The embedded runtime continues after the exact EINVAL but preserves unrelated socket failures
Test run created 2026-08-28T21:41:44.361Z · Source: Renderer crash recovery — 0/0 screenshots · 1 assertion✅ 1 expectation passed · 0 failed · 0 pending
ℹ️ ASSERTION — A crashed renderer is replaced by a usable OpenWork page
Test run created 2026-08-28T21:41:50.904Z · Source: |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (77bfd06ed8f72a126ab1aac765a978dfd9c775f8). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
77bfd06 to
27101da
Compare
27101da to
1a926e6
Compare
1a926e6 to
0da1e6c
Compare
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (0da1e6c27a461077fc5fcad6815425760d666a4e). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
0da1e6c to
43d819f
Compare
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (43d819fcbdd12101eeb6f063c8093b0a329aa0cb). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Why this is needed
The current macOS alpha can leave users with a gray Desktop window after the Electron main process encounters this uncaught Node/Undici exception during an HTTP request:
The exception is thrown by the socket Type-of-Service optimization outside the normal
fetch()rejection boundary. Because it escapes the request promise, ordinary request-level error handling cannot catch it. Refreshing initiates another request and can reproduce the same main-process failure, while the existing native window remains as a blank gray shell.This runtime behavior is documented upstream in nodejs/undici#5544. The corresponding upstream fix in nodejs/undici#5547 treats Type-of-Service application as best-effort so that an unsupported socket hint does not terminate the process.
What this changes
setTypeOfService EINVALfailure emitted by the embedded Node runtime.EINVAL, verifies that a real HTTP request completes, and verifies that an unrelatedEACCESstill propagates.Objective compatibility boundary
This PR does not introduce a custom networking opinion or product policy:
Errorwhose code isEINVALand whose syscall or message identifiessetTypeOfService.The compatibility guard can be revisited after every supported Desktop runtime includes the upstream fix, but the process-level rejection containment and bounded renderer recovery remain useful independently.
Verification
Verdict: Passed at
43d819fcbdd12101eeb6f063c8093b0a329aa0cb.Daytona tooling is installed, but Daytona API credentials were unavailable, so the documented isolated local fallback lane was used.
CI=true pnpm evals:pr specs/desktop-socket-tos-resilience.test.tsCI=true pnpm evals:e2e desktop-renderer-crash-recovery --localCI=true pnpm --dir apps/desktop testCI=true pnpm --dir apps/desktop typecheck:electronCI=true pnpm --dir apps/desktop check:electronCI=true pnpm --dir apps/desktop build:electronCI=true pnpm --dir evals lint:layersThe standalone eval workspace does not currently expose its own
tscbinary, sopnpm --dir evals typecheckcould not start. Invoking the root compiler against the full eval configuration surfaced broad repository/build-state errors outside this change and was not used as verdict evidence. The two changed specs themselves executed successfully through their supported Vitest/testkit lanes.No updater-channel, release, deployment, or installed-application change is included in this PR.