{"record":{"id":"b34cc0f5adea636c","repo":"exo-explore/exo","slug":"msg","errorCode":null,"errorMessage":"{msg}","messagePattern":"\\{msg\\}","errorType":"exception","errorClass":"HuggingFaceAuthenticationError","httpStatus":null,"severity":"error","filePath":"src/exo/download/download_utils.py","lineNumber":503,"sourceCode":"\n\nasync def _fetch_file_list(\n    model_id: ModelId, revision: str = \"main\", path: str = \"\", recursive: bool = False\n) -> list[FileListEntry]:\n    api_url = f\"{get_hf_endpoint()}/api/models/{model_id}/tree/{revision}\"\n    url = f\"{api_url}/{path}\" if path else api_url\n    # ?recursive=true returns the whole subtree in one request\n    if recursive:\n        url = f\"{url}?recursive=true\"\n\n    headers = await get_download_headers()\n    async with (\n        create_http_session(timeout_profile=\"short\") as session,\n        session.get(url, headers=headers) as response,\n    ):\n        if response.status in [401, 403]:\n            msg = await _build_auth_error_message(response.status, model_id)\n            raise HuggingFaceAuthenticationError(msg)\n        elif response.status == 429:\n            raise HuggingFaceRateLimitError(\n                f\"HuggingFace rate limit hit fetching file list for {model_id}\",\n                retry_after=_parse_retry_after(response.headers),\n            )\n        elif response.status == 200:\n            data_json = await response.text()\n            data = TypeAdapter(list[FileListEntry]).validate_json(data_json)\n            files: list[FileListEntry] = []\n            for item in data:\n                if item.type == \"file\":\n                    files.append(FileListEntry.model_validate(item))\n                elif item.type == \"directory\" and recursive:\n                    # already inlined by ?recursive=true\n                    continue\n            if recursive and len(data) >= 1000:\n                # HF tree endpoint paginates at 1000; we don't follow cursors\n                logger.warning(","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/exo-explore/exo/blob/21a54c5ea0230a3bec1e1a786d200126c7e34ec6/src/exo/download/download_utils.py#L485-L521","documentation":"Error \"{msg}\" thrown in exo-explore/exo.","triggerScenarios":"Thrown at src/exo/download/download_utils.py:503 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":"21a54c5ea0230a3bec1e1a786d200126c7e34ec6","analyzedAt":"2026-08-26T00:02:16.033Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}