{"record":{"id":"85ab21efff918bac","repo":"agentscope-ai/agentscope","slug":"host-cache-dir-must-not-be-empty-85ab21","errorCode":null,"errorMessage":"host_cache_dir must not be empty.","messagePattern":"host_cache_dir must not be empty\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/agentscope/workspace/_bubblewrap/_bubblewrap_workspace.py","lineNumber":136,"sourceCode":"                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\n        self._gateway_token = \"\"\n        self._gateway_nonce = \"\"\n        self._rotate_gateway_credentials()\n        self.share_net = share_net\n        self.env = dict(env or {})\n        self.extra_pip = list(extra_pip or [])\n        self.instructions = instructions\n","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/workspace/_bubblewrap/_bubblewrap_workspace.py#L118-L154","documentation":"host_cache_dir, like host_workdir, must be a non-empty string when provided. An empty or whitespace-only value cannot be bind-mounted as the sandbox cache and is rejected at construction.","triggerScenarios":"BubblewrapWorkspace(host_cache_dir='') or '  ', typically from optional config fields left blank.","commonSituations":"Serialized config where an optional cache path round-trips as '' instead of null; UI forms submitting empty strings.","solutions":["Pass None instead of an empty string when no cache dir is wanted","Normalize inputs: cache = cfg.get('host_cache_dir') or None"],"exampleFix":"# before\nws = BubblewrapWorkspace(host_cache_dir=cfg['cache_dir'])  # '' when unset\n# after\nws = BubblewrapWorkspace(host_cache_dir=cfg.get('host_cache_dir') or None)","handlingStrategy":"validation","validationCode":"host_cache_dir = cfg.get('host_cache_dir') or None","typeGuard":"def non_empty_or_none(v: str | None) -> str | None:\n    return v.strip() or None if isinstance(v, str) else None","tryCatchPattern":"null","preventionTips":["Coerce empty config strings to None before passing to the constructor"],"tags":["bubblewrap","config","validation","empty-string"],"backgroundTag":"empty-config-value","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}