fix(desktop): stop the Windows serve watchdog from killing healthy backends (salvage #83556) - #83615
Merged
Merged
Conversation
Contributor
૮ >ﻌ< ა ci reviewran on 564fc9e — chore: contributor email mapping for salvaged commit
|
This was referenced Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Windows Desktop backends no longer kill themselves at boot: the serve parent-death watchdog now probes the recorded Desktop PID for liveness instead of comparing it to
os.getppid().Root cause: #83406's watchdog assumed
HERMES_PARENT_PID(the Electron PID) is the backend's immediate parent. On Windows the Desktop launches the backend through the venvhermes.EXEshim, so the backend's PPID is the shim — the comparison always fails and the watchdogos._exit(0)s a healthy backend ~2s afterHERMES_BACKEND_READY. Every Windows Desktop boot on current main hits this; Retry/Repair can't recover because they reinstall the same code.Salvaged from #83556 by @insane66613 (authorship preserved). Duplicate #83604 by @LKrystalL arrived ~1h later with a weaker Windows-only ctypes probe (access-denied reads a live parent as dead) and no tests.
Changes
hermes_cli/web_server.py:_is_serve_orphaned()probes the Desktop PID via the Windows-safegateway.status._pid_exists()(psutil OpenProcess — avoids theos.kill(pid, 0)Ctrl+C trap); probe errors fail safe to "keep serving"; orphan reap intent preserved (dead Desktop still exits 0) on all platformstests/hermes_cli/test_serve_parent_watchdog.py: regression coverage for live owner, dead owner, and broken-probe fail-safeValidation
test_serve_parent_watchdog(new)test_dashboard_admin_endpoints+test_spawn_gateway_restart_reapaudit_pr_attribution.py --fix)Infographic