Fix v1 MCP setup in task sandboxes#1391
Open
xeophon wants to merge 1 commit into
Open
Conversation
ApprovabilityVerdict: Needs human review This PR introduces significant runtime behavioral changes to sandbox setup, including automatic Python version detection and installation, environment variable isolation, and shell command wrapping. The complexity and runtime impact of these changes warrant human review. You can customize Macroscope's approvability policy. Learn more. |
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
Testing
Note
Medium Risk
Touches sandbox bootstrap shell commands for package installation and MCP proxy startup; regressions could break tool availability or sandbox setup across different base images/Python versions.
Overview
Fixes v1 MCP sandbox reliability by hardening package installation and making the MCP proxy run under the correct interpreter.
Sandbox package installs now ignore image-provided pip configuration/env (e.g.
PIP_INDEX_URL) and, when installingmcpon images with Python < 3.10, provision a Python 3.11 interpreter viauvand record its path inMCP_PROXY_PYTHON_PATH.The MCP proxy launch command is updated to run via
/bin/sh -lcand prefer the recorded interpreter path (falling back topython3), and tests are updated/added to assert the new behavior.Reviewed by Cursor Bugbot for commit 1049158. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix MCP proxy setup in v1 task sandboxes to use a dynamically resolved Python interpreter
proxy_commandnow returns a/bin/sh -lcshell invocation that reads the preferred Python path from/tmp/vf_mcp_python(set asMCP_PROXY_PYTHON_PATH), falling back topython3if absent.python_package_install_commandnow strips image-level pip config (PIP_CONFIG_FILE,PIP_INDEX_URL, etc.) before installing packages, preventing base-image pip settings from interfering.mcpand the current Python is < 3.10, the install script bootstrapsuv, installs Python 3.11, and writes the new interpreter path toMCP_PROXY_PYTHON_PATHsoproxy_commandpicks it up at runtime.python3binary; the interpreter is now resolved at runtime from a file written during package installation.Macroscope summarized 1049158.