Skip to content

fix(gateway): use portable ps scan for gateway PIDs - #22698

Closed
iuyua9 wants to merge 1 commit into
NousResearch:mainfrom
iuyua9:fix/gateway-pids-portable-ps-iuyua9
Closed

fix(gateway): use portable ps scan for gateway PIDs#22698
iuyua9 wants to merge 1 commit into
NousResearch:mainfrom
iuyua9:fix/gateway-pids-portable-ps-iuyua9

Conversation

@iuyua9

@iuyua9 iuyua9 commented May 9, 2026

Copy link
Copy Markdown

Summary:

  • avoid Linux-specific ps eww flags when scanning gateway processes on non-Windows systems
  • use ps aux directly on macOS, where the BSD ps output shape is stable for this scan
  • keep structured ps -A ww -o pid=,command= on other POSIX systems and fall back to ps aux when that output is empty
  • add regression coverage for macOS command selection and the POSIX fallback path

Why:

  • find_gateway_pids() backs hermes gateway status and update/restart flows
  • if the process-table scan returns empty on macOS, Hermes can report that a manual gateway is not running even when it is
  • this keeps PID-file detection intact and only hardens the supplemental process scan

Tests:

  • python3 -m pytest tests/hermes_cli/test_gateway.py -q
  • git diff --check

Related:

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cli CLI entry point, hermes_cli/, setup wizard labels May 9, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing in favor of #22860 (salvage of #22693 by @wesleysimplicio). #22693 addresses a more severe failure mode — slim Docker images that ship without procps at all (no ps binary), which is the dominant production deployment surface. Your /proc-less macOS BSD ps flag matrix targets a different failure mode (#10684) which is complementary and can layer on top in a follow-up — your ps aux matrix would replace the still-broken ps -A eww fallback that #22693 keeps in its no-/proc branch. Thanks for the contribution!

@teknium1 teknium1 closed this May 10, 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/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants