Skip to content

fix(gateway): PID detection fails on Windows — two issues (#25421)#25488

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-65abd7c4
May 14, 2026
Merged

fix(gateway): PID detection fails on Windows — two issues (#25421)#25488
teknium1 merged 1 commit into
mainfrom
hermes/hermes-65abd7c4

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Two Windows-specific bugs in gateway PID detection:

  1. _read_process_cmdline had no psutil fallback path for Windows
    (only /proc and POSIX ps) — always returned empty on Win.
  2. _record_looks_like_gateway didn't normalize backslashes in path
    matching, so Windows-style C:\Users\…\hermes_cli\main.py paths
    never matched.

Both fixes are minimal and Windows-gated.

Salvage of #25421 by @Tianyu199509.

- _read_process_cmdline: /proc and 'ps' are unavailable on Windows,
  so process cmdline was always empty. Add psutil fallback (already
  a hard dependency used by _pid_exists in the same module).

- _record_looks_like_gateway: argv paths use backslashes on Windows
  but patterns use forward slashes/dots, so the fallback record check
  always failed. Normalize backslashes to forward slashes before
  matching.

Together these caused get_running_pid() to return None on Windows
even when the gateway process is alive, making the dashboard report
gateway as 'stopped' despite it functioning normally.
@teknium1 teknium1 merged commit fd9c150 into main May 14, 2026
4 checks passed
@teknium1 teknium1 deleted the hermes/hermes-65abd7c4 branch May 14, 2026 06:11
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-65abd7c4 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8319 on HEAD, 8319 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4380 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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