{"record":{"id":"654ea4b0778f19eb","repo":"agentscope-ai/agentscope","slug":"bubblewrapworkspacemanager-currently-requires-shar","errorCode":null,"errorMessage":"BubblewrapWorkspaceManager currently requires share_net=True because BubblewrapWorkspace uses a TCP MCP gateway across separate bwrap executions.","messagePattern":"BubblewrapWorkspaceManager currently requires share_net=True because BubblewrapWorkspace uses a TCP MCP gateway across separate bwrap executions\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/agentscope/app/workspace_manager/_bubblewrap_workspace_manager.py","lineNumber":84,"sourceCode":"                gateway design.\n            env (`dict[str, str] | None`, optional):\n                Extra environment variables for every workspace.\n            extra_pip (`list[str] | None`, optional):\n                Extra gateway venv requirements.\n            default_mcps (`list[MCPClient] | None`, optional):\n                MCPs seeded into new workspaces.\n            skill_paths (`list[str] | None`, optional):\n                Skill dirs seeded into new workspaces.\n            ttl (`float`, defaults to `3600.0`):\n                Seconds before an idle workspace is evicted.\n            sweep_interval (`float`, defaults to `300.0`):\n                Seconds between sweeper ticks.\n        \"\"\"\n        if not basedir.strip():\n            raise ValueError(\"basedir must not be empty.\")\n        BubblewrapWorkspace._validate_gateway_port(gateway_port)\n        if not share_net:\n            raise ValueError(\n                \"BubblewrapWorkspaceManager currently requires \"\n                \"share_net=True because BubblewrapWorkspace uses a TCP MCP \"\n                \"gateway across separate bwrap executions.\",\n            )\n\n        self._basedir = os.path.abspath(basedir)\n        self._gateway_port = gateway_port\n        self._share_net = share_net\n        self._env = dict(env or {})\n        self._extra_pip = list(extra_pip or [])\n        self._default_mcps = list(default_mcps or [])\n        self._skill_paths = list(skill_paths or [])\n        self._ttl = ttl\n        self._sweep_interval = sweep_interval\n        super().__init__(isolation=isolation)\n\n        self._cache: dict[str, tuple[BubblewrapWorkspace, float]] = {}\n        self._lock = asyncio.Lock()","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/app/workspace_manager/_bubblewrap_workspace_manager.py#L66-L102","documentation":"BubblewrapWorkspaceManager requires share_net=True because its BubblewrapWorkspace implementation talks to a TCP MCP gateway across separate bwrap executions, which needs a shared network namespace. Constructing the manager with share_net=False raises this immediately.","triggerScenarios":"Passing share_net=False (or relying on a default of False) to BubblewrapWorkspaceManager.__init__.","commonSituations":"Hardening sandboxes and disabling networking without knowing the MCP gateway dependency; copying options from a DockerWorkspaceManager config; version upgrade that introduced the gateway design.","solutions":["Set share_net=True explicitly when constructing BubblewrapWorkspaceManager","If network isolation is required, restrict egress with firewall rules around the gateway port instead of share_net=False","Consider DockerWorkspaceManager if its isolation model fits better"],"exampleFix":"# before\nmgr = BubblewrapWorkspaceManager(basedir=d, share_net=False)\n# after\nmgr = BubblewrapWorkspaceManager(basedir=d, share_net=True, gateway_port=port)","handlingStrategy":"validation","validationCode":"mgr = BubblewrapWorkspaceManager(basedir=d, share_net=True)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin share_net=True in your workspace factory","Document the TCP gateway requirement for ops teams"],"tags":["bubblewrap","workspace","network","config"],"backgroundTag":"invalid-configuration","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}