{"record":{"id":"df000d986d0b7ffd","repo":"HKUDS/nanobot","slug":"working-dir-is-outside-the-configured-workspace","errorCode":null,"errorMessage":"working_dir is outside the configured workspace","messagePattern":"working_dir is outside the configured workspace","errorType":"exception","errorClass":"CliAppError","httpStatus":null,"severity":"error","filePath":"nanobot/apps/cli/service.py","lineNumber":1347,"sourceCode":"        return self.payload() | {\n            \"last_action\": {\n                \"ok\": ok,\n                \"message\": f\"{entry} --help exited {result.returncode}\",\n                \"output\": output,\n            }\n        }\n\n    def _resolve_cwd(\n        self,\n        working_dir: str | None,\n        *,\n        restrict_to_workspace: bool,\n    ) -> Path:\n        cwd = Path(working_dir).expanduser() if working_dir else self.workspace\n        cwd = cwd.resolve(strict=False)\n        workspace = self.workspace.resolve(strict=False)\n        if restrict_to_workspace and not is_path_within(cwd, workspace):\n            raise CliAppError(\"working_dir is outside the configured workspace\")\n        return cwd\n\n    def _iter_artifact_candidates(self, cwd: Path) -> list[Path]:\n        if not cwd.is_dir():\n            return []\n        out: list[Path] = []\n        stack = [cwd]\n        scanned = 0\n        while stack and scanned < _MAX_ARTIFACT_SCAN_PATHS:\n            directory = stack.pop()\n            try:\n                entries = sorted(directory.iterdir(), key=lambda path: path.name.lower())\n            except OSError:\n                continue\n            for path in entries:\n                if scanned >= _MAX_ARTIFACT_SCAN_PATHS:\n                    break\n                scanned += 1","sourceCodeStart":1329,"sourceCodeEnd":1365,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/apps/cli/service.py#L1329-L1365","documentation":"Error \"working_dir is outside the configured workspace\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/apps/cli/service.py:1347 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}