Skip to content

fix(desktop): stop the Windows serve watchdog from killing healthy backends (salvage #83556) - #83615

Merged
teknium1 merged 2 commits into
mainfrom
fix/83556-windows-serve-watchdog
Aug 11, 2026
Merged

fix(desktop): stop the Windows serve watchdog from killing healthy backends (salvage #83556)#83615
teknium1 merged 2 commits into
mainfrom
fix/83556-windows-serve-watchdog

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

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 venv hermes.EXE shim, so the backend's PPID is the shim — the comparison always fails and the watchdog os._exit(0)s a healthy backend ~2s after HERMES_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-safe gateway.status._pid_exists() (psutil OpenProcess — avoids the os.kill(pid, 0) Ctrl+C trap); probe errors fail safe to "keep serving"; orphan reap intent preserved (dead Desktop still exits 0) on all platforms
  • tests/hermes_cli/test_serve_parent_watchdog.py: regression coverage for live owner, dead owner, and broken-probe fail-safe

Validation

Check Result
test_serve_parent_watchdog (new) 2/2
test_dashboard_admin_endpoints + test_spawn_gateway_restart_reap pass
E2E: real child process as owner — live kept, dead detected pass
Attribution audit (audit_pr_attribution.py --fix) clean

Infographic

Windows Desktop backend watchdog fix

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 564fc9e — chore: contributor email mapping for salvaged commit

⚠️ 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.


debug info

CI timings

CI timings · View report · View job

Wall time 3m14s vs 6m45s (-52.1%). 15 job(s) slower, 9 faster, 1 unchanged.

  • Python tests / Run tests slice 10/12: +40.0s
  • Python tests / Run tests slice 12/12: +29.0s
  • Python tests / Run tests slice 6/12: -11.0s
  • Python tests / Run tests slice 3/12: +11.0s
  • OS-specific tests / macOS-only tests: +11.0s

@teknium1
teknium1 merged commit 2cdb30a into main Aug 11, 2026
45 checks passed
@teknium1
teknium1 deleted the fix/83556-windows-serve-watchdog branch August 11, 2026 02:17
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/cli CLI entry point, hermes_cli/, setup wizard 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 labels Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/desktop Electron desktop app (apps/desktop/*) 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.

3 participants