{"record":{"id":"eb16d37658e79dd1","repo":"agentscope-ai/agentscope","slug":"bubblewrapworkspace-currently-requires-share-net-t","errorCode":null,"errorMessage":"BubblewrapWorkspace currently requires share_net=True because its TCP MCP gateway must be reachable across separate bwrap executions.","messagePattern":"BubblewrapWorkspace currently requires share_net=True because its TCP MCP gateway must be reachable across separate bwrap executions\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/agentscope/workspace/_bubblewrap/_bubblewrap_workspace.py","lineNumber":128,"sourceCode":"                Must be ``True`` for this workspace because the TCP MCP\n                gateway is reached across separate ``bwrap`` executions.\n            env (`dict[str, str] | None`, optional):\n                Extra environment variables for sandboxed commands.\n            extra_pip (`list[str] | None`, optional):\n                Extra Python requirements installed into the gateway venv.\n                For a persistent ``host_workdir``, keep this list stable\n                across workspace instances; changing it does not currently\n                invalidate an existing Bootstrap environment.\n            instructions (`str`, optional):\n                System-prompt fragment template.\n            default_mcps (`list[MCPClient] | None`, optional):\n                MCPs seeded on first initialization.\n            skill_paths (`list[str] | None`, optional):\n                Local skill directories seeded on first initialization.\n        \"\"\"\n        self._validate_gateway_port(gateway_port)\n        if not share_net:\n            raise ValueError(\n                \"BubblewrapWorkspace currently requires share_net=True \"\n                \"because its TCP MCP gateway must be reachable across \"\n                \"separate bwrap executions.\",\n            )\n        if host_workdir is not None and not host_workdir.strip():\n            raise ValueError(\"host_workdir must not be empty.\")\n        if host_cache_dir is not None and not host_cache_dir.strip():\n            raise ValueError(\"host_cache_dir must not be empty.\")\n\n        super().__init__(\n            workspace_id=workspace_id,\n            default_mcps=default_mcps,\n            skill_paths=skill_paths,\n        )\n\n        self.workdir = SANDBOX_WORKDIR\n        self.gateway_port = gateway_port\n        self._gateway_port_input = gateway_port","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/workspace/_bubblewrap/_bubblewrap_workspace.py#L110-L146","documentation":"BubblewrapWorkspace runs a TCP MCP gateway that must stay reachable across separate bwrap invocations, which requires a shared network namespace. Constructing with share_net=False is therefore unsupported and rejected in __init__.","triggerScenarios":"BubblewrapWorkspace(share_net=False) — the only trigger; the check runs before any other setup.","commonSituations":"Copy-pasting config from other sandbox backends that allow network isolation; hardening attempts that disable networking without realizing the gateway needs it.","solutions":["Omit share_net (defaults to True) or set it explicitly to True","If network isolation is mandatory, use a different workspace backend without the TCP MCP gateway"],"exampleFix":"# before\nws = BubblewrapWorkspace(share_net=False)\n# after\nws = BubblewrapWorkspace(share_net=True)","handlingStrategy":"validation","validationCode":"assert share_net is not False, 'BubblewrapWorkspace requires share_net=True'","typeGuard":"null","tryCatchPattern":"except ValueError as e:\n    if 'share_net' in str(e): use a non-bubblewrap backend","preventionTips":["Don't copy sandbox-hardening flags from other backends","Document that the TCP MCP gateway needs shared networking"],"tags":["bubblewrap","network","config","mcp"],"backgroundTag":"unsupported-configuration-value","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}