{"record":{"id":"e9f0764a4402063d","repo":"agentscope-ai/agentscope","slug":"bubblewrapworkspace-requires-linux","errorCode":null,"errorMessage":"BubblewrapWorkspace requires Linux.","messagePattern":"BubblewrapWorkspace requires Linux\\.","errorType":"error_code","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/agentscope/workspace/_bubblewrap/_bubblewrap_workspace.py","lineNumber":193,"sourceCode":"            return\n        if (\n            isinstance(gateway_port, bool)\n            or not isinstance(gateway_port, int)\n            or not 1 <= gateway_port <= 65535\n        ):\n            raise ValueError(\n                \"gateway_port must be None or an integer from 1 to 65535.\",\n            )\n\n    @property\n    def is_persistent(self) -> bool:\n        \"\"\"Whether the workspace files survive ``close``.\"\"\"\n        return self._host_workdir_input is not None\n\n    async def _provision_backend(self) -> None:\n        \"\"\"Validate Bubblewrap availability and bind the backend.\"\"\"\n        if not sys.platform.startswith(\"linux\"):\n            raise RuntimeError(\"BubblewrapWorkspace requires Linux.\")\n        if shutil.which(\"bwrap\") is None:\n            raise RuntimeError(\"BubblewrapWorkspace requires 'bwrap' on PATH.\")\n        await self._probe_bubblewrap()\n        if self._host_workdir_input is None:\n            self._owned_workdir = tempfile.TemporaryDirectory()\n            self.host_workdir = self._owned_workdir.name\n        else:\n            self.host_workdir = os.path.abspath(self._host_workdir_input)\n        workdir_created = not os.path.lexists(self.host_workdir)\n        os.makedirs(self.host_workdir, mode=0o700, exist_ok=True)\n        if not os.path.isdir(self.host_workdir):\n            raise ValueError(\"host_workdir must be a directory.\")\n        if workdir_created:\n            os.chmod(self.host_workdir, 0o700)\n\n        if (\n            self._host_workdir_input is None\n            and self._host_cache_dir_input is None","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/workspace/_bubblewrap/_bubblewrap_workspace.py#L175-L211","documentation":"Bubblewrap (bwrap) is a Linux-only sandboxing tool, and BubblewrapWorkspace checks sys.platform during backend provisioning. On macOS or Windows the workspace cannot start and raises RuntimeError.","triggerScenarios":"Constructing/starting BubblewrapWorkspace on any non-Linux platform (dev on macOS, CI on windows-latest, etc.).","commonSituations":"Developing locally on a Mac while targeting Linux servers; cross-platform test suites that instantiate every workspace backend.","solutions":["Select a different Workspace implementation on non-Linux platforms (duck-typed switch on sys.platform)","Run the agent inside a Linux container/VM (Docker devcontainer)","Skip bubblewrap tests with pytest.mark.skipif(sys.platform != 'linux')"],"exampleFix":"# before\nws = BubblewrapWorkspace(...)\n# after\nimport sys\nif sys.platform.startswith('linux'):\n    ws = BubblewrapWorkspace(...)\nelse:\n    ws = LocalWorkspace(...)","handlingStrategy":"type-guard","validationCode":"import sys\nassert sys.platform.startswith('linux'), 'BubblewrapWorkspace requires Linux'","typeGuard":"def bubblewrap_supported() -> bool:\n    import sys\n    return sys.platform.startswith('linux')","tryCatchPattern":"null","preventionTips":["Branch workspace backend selection on sys.platform","Run agents in Linux containers for parity"],"tags":["bubblewrap","platform","linux-only"],"backgroundTag":"unsupported-platform","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}