{"record":{"id":"ddce01f17ebed600","repo":"HKUDS/Vibe-Trading","slug":"run-id-run-id-r-was-not-found-under-allowed-run","errorCode":null,"errorMessage":"run_id {run_id!r} was not found under allowed run roots.\n{_describe_roots(roots)}","messagePattern":"run_id (.+?) was not found under allowed run roots\\.\n(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/tools/path_utils.py","lineNumber":400,"sourceCode":"        ValueError: If the run id is empty, path-shaped, or not found.\n    \"\"\"\n    _rejects_unc(run_id)\n    candidate = Path(run_id)\n    if (\n        not run_id.strip()\n        or candidate.is_absolute()\n        or len(candidate.parts) != 1\n        or any(part in {\"\", \".\", \"..\"} for part in candidate.parts)\n    ):\n        raise ValueError(f\"run_id {run_id!r} must be a bare run directory name\")\n\n    roots = _allowed_run_roots()\n    for root in roots:\n        resolved = (root / candidate.name).resolve()\n        if resolved.is_relative_to(root) and resolved.is_dir():\n            return resolved\n\n    raise ValueError(\n        f\"run_id {run_id!r} was not found under allowed run roots.\\n\"\n        f\"{_describe_roots(roots)}\"\n    )\n","sourceCodeStart":382,"sourceCodeEnd":404,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/tools/path_utils.py#L382-L404","documentation":"After safe_run_id validates the bare name, it searches each allowed run root for root/name as an existing directory. If none matches, this 'not found' error with the searched roots is raised.","triggerScenarios":"A correctly formatted run_id whose directory doesn't exist, exists under a non-allowlisted root, or the env var pointing elsewhere.","commonSituations":"Verifying a run archived/moved after creation, typos in the id, or allowed-run-roots not configured in the current process.","solutions":["Confirm the directory exists under one of the roots shown in the error","Fix typos / re-derive the id from the run creation response","Re-add the run's parent directory via allowed-run-roots env var"],"exampleFix":"# before\nsafe_run_id(\"run-9999\")  # does not exist\n# after\nsafe_run_id(\"run-0042\")  # actual directory name","handlingStrategy":"validation","validationCode":"from agent.src.tools.path_utils import _allowed_run_roots\nname = run_id.strip()\nexists = any((r / name).is_dir() for r in _allowed_run_roots())\nif not exists:\n    raise NotFoundError(f\"run {name} not found\")","typeGuard":"def run_exists(rid: str) -> bool:\n    name = rid.strip()\n    return any((r / name).resolve().is_relative_to(r) and (r / name).is_dir() for r in _allowed_run_roots())","tryCatchPattern":"try:\n    rd = safe_run_id(run_id)\nexcept ValueError as e:\n    if \"was not found\" in str(e):\n        runs = list_available_runs(); suggest_closest(run_id, runs)","preventionTips":["Persist run ids at creation time","Validate existence before building downstream reports","Keep allowed-run-roots stable across archive/restore"],"tags":["run-id","not-found","filesystem"],"backgroundTag":"resource-not-found","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}