Skip to content

fix(desktop): stop app-managed gateway on backend shutdown - #77297

Closed
QuarkAssistant wants to merge 3 commits into
NousResearch:mainfrom
QuarkAssistant:fix/77276-desktop-gateway-orphan
Closed

QuarkAssistant wants to merge 3 commits into
NousResearch:mainfrom
QuarkAssistant:fix/77276-desktop-gateway-orphan

Conversation

@QuarkAssistant

@QuarkAssistant QuarkAssistant commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • complement the startup orphan sweep now on main by covering graceful Desktop backend shutdown
  • terminate the live app-managed gateway-restart child when the Desktop serve lifespan exits
  • keep the shutdown regression isolated from the startup reaper and shared action-process state

TDD evidence

  • RED: uv run pytest tests/hermes_cli/test_dashboard_admin_endpoints.py::test_desktop_lifespan_terminates_managed_gateway_restart -q failed because the gateway child was not terminated
  • GREEN: the same regression passes after the fix
  • Relevant suites: 327 passed, 1 skipped
  • Blocking lint: uv run ruff check . passed
  • Windows footgun scan: 944 file(s) scanned, no findings
  • Real subprocess shutdown probe: managed child exited on SIGTERM with code -15

Fixes #77276

@QuarkAssistant
QuarkAssistant marked this pull request as ready for review August 3, 2026 03:34
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/desktop Electron desktop app (apps/desktop/*) comp/dashboard Web dashboard / control panel UI (dashboard/, landing) comp/gateway Gateway runner, session dispatch, delivery sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Aug 3, 2026
@QuarkAssistant
QuarkAssistant force-pushed the fix/77276-desktop-gateway-orphan branch from cfcaf98 to 2509601 Compare August 11, 2026 00:47
@teknium1

Copy link
Copy Markdown
Collaborator

Merged via PR #83542 — your commit(s) were cherry-picked onto current main with your authorship preserved in git log (rebase merge). Thank you for the contribution!

This follow-up PR completed the EMFILE hardening cluster after #83406: restart-path gateway orphan reap, Desktop-managed gateway termination on serve shutdown, SSH-spawn ulimit raise, and the dashboard iterdir→scandir fd-leak fixes. Everything was live-tested end-to-end on a real serve backend before merge, including a hostile unreadable-profile-dir fixture that surfaced (and fixed) a pre-existing /api/profiles 500 along the way.

@teknium1 teknium1 closed this Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/dashboard Web dashboard / control panel UI (dashboard/, landing) comp/desktop Electron desktop app (apps/desktop/*) comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop app restart leaves orphan gateway (app-managed spawn path not covered by #75936 fix)

3 participants