Repository navigation
Use sys.executable instead of tee for the stdio placeholder command - #4478
Merged
Merged
Conversation
tests/mcp/helpers.py resolved `tee` at import time and asserted on it. `tee` is a Unix utility and is not on PATH on a default Windows install, so the assert fired during collection and took down every module importing this helper. The value is only ever passed as MCPServerStdio's `command`, and those tests patch `mcp.client.stdio.stdio_client`, so the command is never executed. It just has to be a path that exists. sys.executable is present on every platform by definition.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/mcp/helpers.pyresolvedteeat import time and asserted on the result:teeis a Unix utility. It is not onPATHon a default Windows install, so the assert fires during collection and takes down every module that imports this helper. That is 11 modules, seven undertests/mcp/plustests/voice/test_pipeline.py,tests/test_agent_as_tool.py,tests/test_process_model_response.pyandtests/test_tool_origin.py.The value is only ever used as
MCPServerStdio(params={"command": tee}), and those tests patchmcp.client.stdio.stdio_clientwithDummyStreamsContextManager, so the command is never executed. It only has to be a path that exists.sys.executablesatisfies that on every platform by definition.CI does not see this because GitHub's
windows-latestimage ships Git for Windows with itsusr/binonPATH, which providestee.EXE. A Windows machine without that directory onPATHdoes not have it.Test plan
Same checkout, same machine, only
PATHdiffering, on Windows 11 / Python 3.13.11:uv run ruff format --checkanduv run ruff checkare clean on the changed file.make typecheckreports three errors on this machine, all insrc/agents/sandbox/, none touched here. They are platform-conditional rather than caused by this change:mypy srcgives 3 errors andmypy --platform linux srcgivesSuccess: no issues foundon the same checkout. The typecheck job runs onubuntu-latest, so CI does not see them either. Filed separately as #4477 rather than folded in here.Issue number
n/a
Checks
.agents/skills/code-change-verification/scripts/run.sh/reviewbefore submitting this PRThe verification script is a shell script and this was verified on Windows, so I ran the underlying commands directly rather than through it. No new tests: this restores collection of existing ones, and the pass count above is the check.