fix(desktop): stop in-app update from killing its own backend (#37532)#38158
Merged
Conversation
Contributor
🔎 Lint report:
|
kshitijk4poor
approved these changes
Jun 3, 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
Completes the #37532 fix end-to-end: the Hermes Desktop in-app update no longer SIGTERMs its own backend, ending the boot→kill→crash loop where the desktop never reconnects after "Update".
Root cause:
applyUpdatesPosixInApprunshermes update, which calls_kill_stale_dashboard_processes()→ reaps everyhermes dashboardprocess, including the Electron app's own managed backend.Changes
hermes_cli/main.py(@liuhao1024):_find_stale_dashboard_pids()gains a keyword-onlyexclude_pids;_kill_stale_dashboard_processes()readsHERMES_DESKTOP_CHILD_PIDand excludes it — still reaps genuinely-orphaned dashboards.apps/desktop/electron/main.cjs(follow-up):applyUpdatesPosixInAppnow passesHERMES_DESKTOP_CHILD_PID=<live backend pid>in thehermes updateenv. Without this the Python half was a no-op (nothing set the var).Why two commits
PR #37538 (liuhao1024) shipped only the Python half and touched zero desktop files, so
excludewas alwaysNoneand the backend still got killed. The desktop wiring is the load-bearing half; added on top with contributor authorship preserved.Validation
hermes update(no env)node --check+py_compilecleantests/hermes_cli/test_update_stale_dashboard.py: 22/22 pass_kill_stale_dashboard_processes(mockedps/os.kill): env→backend spared + orphan reaped; no-env→both reaped; garbage env→ignoredNotes: POSIX backends spawn with
shell:false, sohermesProcess.pidis the actual python process whose cmdline the scan matches — PID equality holds. The POSIX in-app path is the only one runninghermes updatedirectly (Windows hands off to the Tauri installer, untouched).Fixes #37532. Supersedes #37538 (cherry-picked with authorship preserved).
Infographic