Repository navigation
Conversation
Sandboxed initialize always installed and health-checked the in-sandbox MCP gateway, even with empty default_mcps and an empty or absent .mcp file. Keep Glob/Grep setup on the base runtime path, start the gateway only when an MCP is configured, and launch it on the first add_mcp. Co-authored-by: mengxiaopeng <602012854@qq.com>
This branch has not been deployed
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
Fixes #2113.
SandboxedWorkspaceBase.initialize()treated the in-sandbox MCP gateway as part of every sandbox, so workspaces that only need Bash, file tools, and Skills still installed a gateway virtualenv and health-checked FastAPI.This change splits Glob/Grep system bootstrap from the MCP gateway lifecycle:
_system_bootstrap_commands()/_ensure_system_runtime()still installripgrepand the Glob helper on everyinitialize().initialize()only whendefault_mcpsis non-empty or the restored.mcpfile lists at least one server.add_mcp()starts the gateway once (concurrent callers share that start; a failed start can be retried).list_mcps()returns[]when no gateway exists;remove_mcp(),reset(), andclose()stay valid in that case.Changes
SandboxedWorkspaceBaseHow I tested this
158 passed, 31 skipped (existing live Docker/E2B/Daytona/Kubernetes/Bubblewrap/Apple Container suites).
black,flake8, andpylint(10.00/10) on the changed files;mypyon_base.pyand_sandboxed_base.pyreported no issues.Checklist