{"record":{"id":"356a65faad0bc320","repo":"langchain-ai/deepagents","slug":"name-zip-entry-uncompressed-size-exceeds-limit","errorCode":null,"errorMessage":"{name}: zip entry uncompressed size exceeds limit","messagePattern":"(.+?): zip entry uncompressed size exceeds limit","errorType":"error_code","errorClass":"FleetImportError","httpStatus":null,"severity":"error","filePath":"libs/talon/deepagents_talon/fleet_import.py","lineNumber":260,"sourceCode":"    posix = PurePosixPath(name)\n    windows = PureWindowsPath(name)\n    return (\n        posix.is_absolute()\n        or windows.is_absolute()\n        or windows.drive != \"\"\n        or any(part in {\"\", \".\", \"..\"} for part in posix.parts)\n    )\n\n\ndef _is_symlink(info: zipfile.ZipInfo) -> bool:\n    file_type = (info.external_attr >> 16) & _ZIP_FILE_TYPE_MASK\n    return file_type == _ZIP_SYMLINK_TYPE\n\n\ndef _validate_zip_entry_size(name: str, info: zipfile.ZipInfo) -> None:\n    if info.file_size > _MAX_ZIP_UNCOMPRESSED_BYTES:\n        msg = f\"{name}: zip entry uncompressed size exceeds limit\"\n        raise FleetImportError(msg)\n    if info.compress_size == 0:\n        return\n    if info.file_size > info.compress_size * _MAX_ZIP_COMPRESSION_RATIO:\n        msg = f\"{name}: zip entry compression ratio exceeds limit\"\n        raise FleetImportError(msg)\n\n\ndef _materialize_staging(\n    archive: zipfile.ZipFile,\n    entries: Mapping[str, zipfile.ZipInfo],\n    staging: Path,\n) -> None:\n    _copy_zip_file(archive, entries[\"AGENTS.md\"], staging / \"AGENTS.md\")\n\n    for name, info in entries.items():\n        if name.startswith(\"skills/\"):\n            _copy_zip_file(archive, info, staging / name)\n        elif _is_subagent_prompt_path(name):","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/talon/deepagents_talon/fleet_import.py#L242-L278","documentation":"A single zip entry declares an uncompressed (`file_size`) value over 256 MiB (`_MAX_ZIP_UNCOMPRESSED_BYTES`). Per-entry size caps are declared-size checks run during validation, before any bytes are extracted, to stop oversized or malicious archives early.","triggerScenarios":"`import_fleet_zip` validates an entry whose `info.file_size > 256 * 1024 * 1024`.","commonSituations":"Export accidentally includes large binaries, model weights, datasets, videos, or docker layer tarballs inside `skills/`.","solutions":["Remove or move the oversized file out of the Fleet export","Verify entry sizes up front: `max(zi.file_size for zi in zipfile.ZipFile(p).infolist())` and locate the offender","Compress or split the asset and reference it externally (URL, separate download) instead of embedding it in the zip"],"exampleFix":"# before: bundled model in skills/\nskills/heavy/model.bin (400 MB)\n// after: ship without the asset and document the download\nskills/heavy/README.md  # 'download model.bin from ...'","handlingStrategy":"validation","validationCode":"import zipfile\n\nMAX_ENTRY = 256 * 1024 * 1024\n\ndef has_oversized_entry(path):\n    with zipfile.ZipFile(path) as z:\n        return any(zi.file_size > MAX_ENTRY for zi in z.infolist())","typeGuard":null,"tryCatchPattern":"try:\n    import_fleet_zip(zip_path, target_dir=target)\nexcept FleetImportError as exc:\n    if \"uncompressed size exceeds limit\" in str(exc):\n        print(\"Remove or externalize the >256MiB asset from the export\")\n    raise","preventionTips":["Keep large binaries out of Fleet exports","Check max entry file_size before importing","Reference heavy assets by URL instead of embedding"],"tags":["zip","limits","size-limit","validation"],"backgroundTag":"zip-entry-size-limit-exceeded","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}