Skip to content

Fix FreeBSD gateway process detection#9396

Open
yeyitech wants to merge 1 commit into
NousResearch:mainfrom
yeyitech:fix-freebsd-gateway-ps
Open

Fix FreeBSD gateway process detection#9396
yeyitech wants to merge 1 commit into
NousResearch:mainfrom
yeyitech:fix-freebsd-gateway-ps

Conversation

@yeyitech

Copy link
Copy Markdown
Contributor

Summary

  • use ps ww on FreeBSD when discovering manual gateway processes so the command column is not prefixed with environment variables
  • keep the existing ps eww behaviour on other Unix platforms where profile detection still benefits from env visibility
  • add regression coverage proving FreeBSD output is parsed correctly and the gateway PID is detected

Testing

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest -o addopts='' tests/hermes_cli/test_update_gateway_restart.py -q
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest -o addopts='' tests/hermes_cli/test_status.py -q

Issues

@houko houko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix — the FreeBSD PID TT STAT TIME COMMAND
21880 s000 S 0:00.64 -zsh
30834 s000 S+ 10:22.77 /Users/xiaomo/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rust-analyzer
75782 s000 S+ 21:07.40 claude
76248 s000 S+ 0:01.49 npm exec @modelcontextprotocol/server-sequential-thinking
76252 s000 S+ 0:01.48 npm exec @upstash/context7-mcp
76344 s000 S+ 0:00.22 /opt/homebrew/bin/uv tool uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
76437 s000 S+ 0:20.95 /Users/xiaomo/.cache/uv/archive-v0/rSUmphA5ygfhDnr2eBWuM/bin/python /Users/xiaomo/.cache/uv/archive-v0/rSUmphA5ygfhDnr2eBWuM/bin/serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
76498 s000 S+ 0:00.32 node /Users/xiaomo/.npm/_npx/eea2bd7412d4593b/node_modules/.bin/context7-mcp
76549 s000 S+ 0:00.18 node /Users/xiaomo/.npm/_npx/de2bd410102f5eda/node_modules/.bin/mcp-server-sequential-thinking
1524 s001 S 0:00.62 -zsh
1835 s001 S+ 19:43.37 claude
2335 s001 S+ 0:01.55 npm exec @modelcontextprotocol/server-sequential-thinking
2356 s001 S+ 0:01.60 npm exec @upstash/context7-mcp
2448 s001 S+ 0:00.19 /opt/homebrew/bin/uv tool uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
2585 s001 S+ 0:05.87 /Users/xiaomo/.cache/uv/archive-v0/eHK3WrDKRKGPtHIJrvSwB/bin/python /Users/xiaomo/.cache/uv/archive-v0/eHK3WrDKRKGPtHIJrvSwB/bin/serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
2734 s001 S+ 0:00.35 node /Users/xiaomo/.npm/_npx/eea2bd7412d4593b/node_modules/.bin/context7-mcp
2735 s001 S+ 0:00.24 node /Users/xiaomo/.npm/_npx/de2bd410102f5eda/node_modules/.bin/mcp-server-sequential-thinking
64659 s002 S 0:00.25 -zsh
65414 s002 S+ 4:43.43 claude
65851 s002 S+ 0:01.78 npm exec @modelcontextprotocol/server-sequential-thinking
65855 s002 S+ 0:01.79 npm exec @upstash/context7-mcp
65946 s002 S+ 0:00.28 /opt/homebrew/bin/uv tool uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
66076 s002 S+ 0:03.45 /Users/xiaomo/.cache/uv/archive-v0/eHK3WrDKRKGPtHIJrvSwB/bin/python /Users/xiaomo/.cache/uv/archive-v0/eHK3WrDKRKGPtHIJrvSwB/bin/serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
66137 s002 S+ 0:00.25 node /Users/xiaomo/.npm/_npx/de2bd410102f5eda/node_modules/.bin/mcp-server-sequential-thinking
66189 s002 S+ 0:00.42 node /Users/xiaomo/.npm/_npx/eea2bd7412d4593b/node_modules/.bin/context7-mcp
22177 s003 S 0:00.71 -zsh
85810 s003 S+ 19:54.04 claude
86271 s003 S+ 0:01.47 npm exec @modelcontextprotocol/server-sequential-thinking
86275 s003 S+ 0:01.45 npm exec @upstash/context7-mcp
86366 s003 S+ 0:00.73 /opt/homebrew/bin/uv tool uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
86664 s003 S+ 0:00.32 node /Users/xiaomo/.npm/_npx/eea2bd7412d4593b/node_modules/.bin/context7-mcp
86716 s003 S+ 0:00.18 node /Users/xiaomo/.npm/_npx/de2bd410102f5eda/node_modules/.bin/mcp-server-sequential-thinking
86788 s003 S+ 0:05.80 /Users/xiaomo/.cache/uv/archive-v0/eHK3WrDKRKGPtHIJrvSwB/bin/python /Users/xiaomo/.cache/uv/archive-v0/eHK3WrDKRKGPtHIJrvSwB/bin/serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
86429 s007 Ss+ 0:01.17 /bin/zsh -il
68174 s008 S+ 0:00.01 just dev
68248 s008 S+ 0:01.26 target/debug/xtask dev
76281 s008 S 0:01.86 -zsh
83172 s008 S+ 0:00.25 node /Users/xiaomo/.local/share/mise/installs/node/22.22.0/bin/pnpm dev
83305 s008 S+ 0:13.49 node /Volumes/Lexar/Workspace/libre/lf-chat-thinking-toggle/crates/librefang-api/dashboard/node_modules/.bin/../vite/bin/vite.js
84742 s008 S+ 0:04.79 /Volumes/Lexar/Workspace/libre/lf-chat-thinking-toggle/crates/librefang-api/dashboard/node_modules/.pnpm/@esbuild+darwin-arm64@0.27.4/node_modules/@esbuild/darwin-arm64/bin/esbuild --service=0.27.4 --ping
85274 s008 S+ 0:00.18 /Users/xiaomo/.cargo/bin/cargo-watch watch --watch crates -s (cargo build -p librefang-cli && /Volumes/Lexar/Workspace/libre/lf-chat-thinking-toggle/target/debug/librefang stop 2>/dev/null; for pid in $(lsof -ti :4545 -sTCP:LISTEN 2>/dev/null); do kill -9 $pid 2>/dev/null; done; rm -f /Users/xiaomo/.librefang/daemon.json; for _i in 1 2 3 4 5 6 7 8 9 10; do lsof -ti :4545 -sTCP:LISTEN >/dev/null 2>&1 || break; sleep 0.3; done && LIBREFANG_PORT=4545 /Volumes/Lexar/Workspace/libre/lf-chat-thinking-toggle/target/debug/librefang start --foreground &)
20486 s009 S 0:00.20 -zsh
20673 s009 S+ 4:31.15 claude
21180 s009 S+ 0:01.59 npm exec @modelcontextprotocol/server-sequential-thinking
21184 s009 S+ 0:01.57 npm exec @upstash/context7-mcp
21275 s009 S+ 0:00.25 /opt/homebrew/bin/uv tool uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
21401 s009 S+ 0:03.09 /Users/xiaomo/.cache/uv/archive-v0/eHK3WrDKRKGPtHIJrvSwB/bin/python /Users/xiaomo/.cache/uv/archive-v0/eHK3WrDKRKGPtHIJrvSwB/bin/serena start-mcp-server --context ide-assistant --enable-web-dashboard false --enable-gui-log-window false
21532 s009 S+ 0:00.35 node /Users/xiaomo/.npm/_npx/eea2bd7412d4593b/node_modules/.bin/context7-mcp
21583 s009 S+ 0:00.20 node /Users/xiaomo/.npm/_npx/de2bd410102f5eda/node_modules/.bin/mcp-server-sequential-thinking
80991 s009 S+ 4:02.39 /Users/xiaomo/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rust-analyzer
81325 s009 S+ 0:06.66 /Users/xiaomo/.rustup/toolchains/stable-aarch64-apple-darwin/libexec/rust-analyzer-proc-macro-srv workaround looks correct. The helper is clean and the test covers the key scenario. 👍

@houko houko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix — FreeBSD ps ww workaround looks correct. 👍

@yeyitech

Copy link
Copy Markdown
Contributor Author

Thanks. Quick heads-up: this PR currently shows no GitHub checks on my side (gh pr checks reports “no checks reported”). Since this is a fork PR into NousResearch/hermes-agent, could a maintainer please take a quick look at whether the repo's CI needs manual approval or whether Actions for fork PRs aren't triggering here?

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery labels Apr 27, 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 P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hermes cron list: Gateway process detection fails on FreeBSD due to ps eww output format

3 participants