Skip to content

[codex] Fix gateway status ps fallback on WSL - #10076

Closed
qwertlooker wants to merge 1 commit into
NousResearch:mainfrom
qwertlooker:codex/gateway-status-ps-fallback
Closed

[codex] Fix gateway status ps fallback on WSL#10076
qwertlooker wants to merge 1 commit into
NousResearch:mainfrom
qwertlooker:codex/gateway-status-ps-fallback

Conversation

@qwertlooker

Copy link
Copy Markdown

Summary

Fix hermes gateway status / hermes status process detection on WSL and Ubuntu variants where ps eww -ax -o ... is rejected by procps.

Root Cause

The non-Windows gateway PID scan used a mixed BSD-style ps eww -ax -o pid=,command= invocation. On the reporter's WSL/Ubuntu environment, that command failed, so gateway process discovery returned no manual gateway PIDs and status commands incorrectly reported that the gateway was not running.

What Changed

  • Prefer ps -eww -ax -o pid=,command= for Linux/WSL process scans.
  • Fall back to ps -ax -o pid=,command= if the extended-environment form is unsupported.
  • Return the already-known service-managed PIDs if both process scans fail instead of crashing or misparsing.
  • Add a regression test covering primary ps failure followed by fallback success.

Impact

hermes gateway status and hermes status now correctly detect manually running gateways on more Linux/WSL procps variants instead of producing false negatives.

Validation

  • python -m pytest tests/hermes_cli/test_update_gateway_restart.py -q -k "falls_back_when_primary_ps_flags_fail or filters_to_current_profile or no_exclude_returns_all or excludes_specified_pids"
  • python -m pytest tests/hermes_cli/test_gateway_wsl.py -q -k "test_status_wsl_running_manual or test_status_wsl_not_running"

Notes

Broader gateway suites still have pre-existing Windows-environment failures in this checkout around launchd/systemd paths and missing async pytest support; they are unrelated to this change.

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

Copy link
Copy Markdown
Collaborator

Related: #10761 (same ps eww -ax incompatibility issue in Docker), #10806 (competing fix for Docker). This PR targets WSL specifically.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded by #22860.

Triage notes (high confidence):
Superseded by merged #22860 which added /proc-based gateway PID detection (works on WSL/Docker without procps); origin/main hermes_cli/gateway.py:399-432 now tries /proc first with 'ps -A eww' as fallback — the 'ps eww -ax' pattern this PR fixes no longer exists.

Thanks for the contribution — the underlying problem this PR addresses has been resolved by the linked PR on current main. If you believe this was closed in error, please comment and we'll reopen.

(Bulk-closed during a CLI PR triage sweep.)

@teknium1 teknium1 closed this May 24, 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.

4 participants