fix(mcp): resolve uv and uvx under filtered PATH - #67125
Conversation
Related to #37665: both update |
|
Thanks for the focused MCP resolver fix. Remote current The patch extends the existing allowlisted fallback rather than widening resolution for arbitrary commands, preserves configured-PATH precedence through Automated hermes-sweeper review. |
macOS GUI sessions can launch stdio MCP servers with a PATH that omits Hermes-managed and common uv install directories. Bare uv and uvx commands then fail before the MCP process starts. Extend the existing trusted launcher fallback to uv and uvx. Preserve the configured PATH first, then check the active profile's managed bin, ~/.local/bin, Apple Silicon Homebrew, and /usr/local/bin, accepting only executable files. Use platform-correct .exe names on Windows. Cover resolver order, profile scope, Windows naming, explicit-PATH precedence, and unknown-command isolation with behavioral tests.
7870391 to
52dca17
Compare
SummaryEight PRs were checked across three linked MCP stdio-resolution issues. #37665, #67125, and #67178 address the remaining uv/uvx GUI-PATH cause of #37589; #56537/#56594 address Windows PATHEXT, #61153 addresses the managed Studio launcher, #8305 addresses WSL cwd warnings, and #67873 adds Node-version-manager lookup roots. Related pull requests
Duplicates#67178 is a functional duplicate of #67125 for the uv/uvx resolver, while #37665 targets the same cause but is superseded by #67125's managed-profile candidate and broader tests. #56594 overlaps #56537 on #56536 and is already closed; #56537 is the broader implementation. Suggested consolidationKeep #67125 open with a salvage path as the recorded best existing fix for #37589, preserving its active-profile managed-uv lookup, fallback-order tests, Windows launcher handling, and unknown-command isolation. Close #67178 as a duplicate of #67125 despite its keep_open verdict because its diff adds no distinct resolver behavior, and close #37665 as a duplicate of #67125 despite its keep_open review because that review's missing managed-uv candidate is implemented and tested in #67125; keep #8305, #56537, #61153, and #67873 open only on their distinct salvage paths, with #8305 and #56537 requiring their contributor-requested corrections, while #56594 remains closed. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I37589(["issue #37589 (open)"])
subgraph Dup37665 ["PRs duplicating each other"]
P37665["PR #37665 (open)"]
P67125["PR #67125 (open)"]
P67178["PR #67178 (open)"]
end
P67125 -->|best fix| I37589
class I37589 open
class P37665 open
class P67125 open
class P67178 open
class P67125 best
class P67125 target
click I37589 "https://github.com/NousResearch/hermes-agent/issues/37589"
click P37665 "https://github.com/NousResearch/hermes-agent/pull/37665"
click P67125 "https://github.com/NousResearch/hermes-agent/pull/67125"
click P67178 "https://github.com/NousResearch/hermes-agent/pull/67178"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 8 pull requests and 3 issues in this complex. Each diff was read against this issue; Assessment working set: 59 kB of PR diffs, 24 kB of issue/PR text, 16 kB of discussion (20 comments), 9 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
Fixes #37589.
uvanduvxMCP launchers against the exact childPATH, then trusted executable fallbacks$HERMES_HOME/binbefore~/.local/bin, Apple Silicon Homebrew, and/usr/local/bin.exelaunchersPrior work
#37665 fixes the same PATH bug but uses the Node-managed path for
uvanduvx. This PR uses$HERMES_HOME/bin, where the Hermes installer puts them.Credit to @dpearson2699 for the bug report and @Morad37 for the earlier fix.
Test plan
scripts/run_tests.sh tests/tools/test_mcp_tool_issue_948.py— 17 passedscripts/run_tests.sh tests/tools/test_mcp_tool_issue_948.py tests/tools/test_mcp_stdio_watchdog.py tests/tools/test_mcp_stdio_init_timeout.py tests/tools/test_mcp_stdio_encoding_handler.py tests/tools/test_mcp_loop_profile_override.py tests/tools/test_mcp_tool.py— 113 passed.venv/bin/ruff check tools/mcp_tool.py tests/tools/test_mcp_tool_issue_948.pypython3 scripts/check-windows-footguns.py --diff refs/remotes/origin/mainuvxresolution and subprocess launch under a filteredPATHuvx 0.11.26resolution and execution outside childPATH