{"record":{"id":"5929bc417d0fcae2","repo":"langchain-ai/deepagents","slug":"notimplementederror-raised-by-abstract-download-f","errorCode":null,"errorMessage":"NotImplementedError raised by abstract `download_files` (backend does not implement `download_files`)","messagePattern":"NotImplementedError raised by abstract `download_files` \\(backend does not implement `download_files`\\)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"libs/deepagents/deepagents/backends/protocol.py","lineNumber":802,"sourceCode":"        return await asyncio.to_thread(self.upload_files, files)\n\n    def download_files(self, paths: list[str]) -> list[FileDownloadResponse]:\n        \"\"\"Download multiple files from the sandbox.\n\n        This API is designed to allow developers to use it either directly or\n        by exposing it to LLMs via custom tools.\n\n        Args:\n            paths: List of file paths to download.\n\n        Returns:\n            List of `FileDownloadResponse` objects, one per input path.\n\n                Response order matches input order (`response[i] for paths[i]`).\n\n                Check the error field to determine success/failure per file.\n        \"\"\"\n        raise NotImplementedError\n\n    async def adownload_files(self, paths: list[str]) -> list[FileDownloadResponse]:\n        \"\"\"Async version of download_files.\"\"\"\n        return await asyncio.to_thread(self.download_files, paths)\n\n\n@dataclass\nclass ExecuteResponse:\n    \"\"\"Result of code execution.\n\n    Simplified schema optimized for LLM consumption.\n    \"\"\"\n\n    output: str\n    \"\"\"Combined stdout and stderr output of the executed command.\"\"\"\n\n    exit_code: int | None = None\n    \"\"\"The process exit code.","sourceCodeStart":784,"sourceCodeEnd":820,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/deepagents/deepagents/backends/protocol.py#L784-L820","documentation":"`BackendProtocol.download_files` is an optional bulk-download API whose base-class stub raises `NotImplementedError`. Backends that don't override it raise this when called. Internally, skill loading (`load_namespaced_skills`, `_list_skills_with_errors`) and output offloading (`_offload_to_backend`) depend on it, so those features fail on backends without download support.","triggerScenarios":"Calling `backend.download_files([...])` or `adownload_files` on a backend without an override; invoking namespace skill loading or output offloading with a backend that lacks bulk downloads.","commonSituations":"Running agents with a minimal custom backend or one configured for execution-only use; composite backends routing to a child that can't download; expecting sandbox file transfer APIs on a state-backed agent.","solutions":["Switch to or configure a backend implementing `download_files` (e.g. a sandbox backend)","Check capability before calling: `type(backend).download_files is not BackendProtocol.download_files`","Catch NotImplementedError around skill-loading/offload code paths and degrade gracefully (skip skills/offload)","Implement `download_files` in your custom backend subclass"],"exampleFix":"// before\nresponses = backend.download_files(['/app/out.log'])\n\n// after\nif type(backend).download_files is not BackendProtocol.download_files:\n    responses = [FileDownloadResponse(path='/app/out.log', error='download unsupported')]\nelse:\n    responses = backend.download_files(['/app/out.log'])","handlingStrategy":"validation","validationCode":"def supports_download(backend) -> bool:\n    return type(backend).download_files is not BackendProtocol.download_files\n\nif supports_download(backend):\n    responses = backend.download_files(paths)\nelse:\n    responses = [FileDownloadResponse(path=p, error='download unsupported') for p in paths]","typeGuard":"def is_download_capable(backend) -> bool:\n    return type(backend).download_files is not BackendProtocol.download_files","tryCatchPattern":"try:\n    responses = backend.download_files(paths)\nexcept NotImplementedError:\n    logger.warning('Backend %s lacks download_files; skipping', type(backend).__name__)\n    responses = []","preventionTips":["Guard skill-loading and offload features with a download-capability check at startup","Choose a sandbox-capable backend if skills or output offload are required","Wrap generic multi-backend code paths in capability detection, not type checks"],"tags":["python","not-implemented","backend-protocol","file-download"],"backgroundTag":"abstract-method-not-implemented","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}