{"record":{"id":"f531f7086e6e13e0","repo":"odysseus-dev/odysseus","slug":"directory-path-is-required","errorCode":null,"errorMessage":"Directory path is required","messagePattern":"Directory path is required","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/personal_routes.py","lineNumber":151,"sourceCode":"\n    Args:\n        personal_docs_manager: PersonalDocsManager instance\n        rag_manager: RAG manager instance (may be None)\n        rag_available: Boolean indicating if RAG is available\n\n    Returns:\n        APIRouter instance with personal docs routes\n    \"\"\"\n    router = APIRouter(prefix=\"/api/personal\")\n\n    def _rag():\n        \"\"\"Get the current RAG manager, retrying init if needed.\"\"\"\n        return get_rag_manager()\n\n    def _resolve_allowed_personal_dir(directory: str) -> str:\n        \"\"\"Resolve a user-supplied personal-docs path under the allowed root.\"\"\"\n        if not directory:\n            raise HTTPException(400, \"Directory path is required\")\n\n        # realpath (not abspath) so a symlink inside PERSONAL_DIR that points\n        # outside it is resolved before the commonpath confinement check below;\n        # abspath only normalises `..` and would let such a symlink escape.\n        base_abs = os.path.realpath(PERSONAL_DIR)\n        candidate = directory if os.path.isabs(directory) else os.path.join(base_abs, directory)\n        resolved = os.path.realpath(candidate)\n        try:\n            in_base = os.path.commonpath([resolved, base_abs]) == base_abs\n        except ValueError:\n            in_base = False\n        if not in_base:\n            raise HTTPException(403, \"Directory must be inside personal documents\")\n        return resolved\n    \n    @router.get(\"\")\n    def api_personal_list(owner: str = Depends(require_user), _admin: None = Depends(require_admin)):\n        \"\"\"Enhanced version that includes directories\"\"\"","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/personal_routes.py#L133-L169","documentation":"Error \"Directory path is required\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Provide the directory path in the request.","Pick a directory in the UI before submitting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}