{"record":{"id":"830829c4f6c98b1a","repo":"agentscope-ai/agentscope","slug":"the-upload-is-total-bytes-over-the-max-total-b","errorCode":null,"errorMessage":"The upload is {total} bytes, over the {MAX_TOTAL_BYTES}-byte limit.","messagePattern":"The upload is (.+?) bytes, over the (.+?)-byte limit\\.","errorType":"exception","errorClass":"SkillUploadError","httpStatus":null,"severity":"error","filePath":"src/agentscope/app/_service/_workspace.py","lineNumber":398,"sourceCode":"        total = 0\n        roots: set[str] = set()\n        for entry in entries:\n            if entry.size > MAX_FILE_BYTES:\n                raise SkillUploadError(\n                    f\"{entry.path!r} is {entry.size} bytes, over the \"\n                    f\"{MAX_FILE_BYTES}-byte per-file limit.\",\n                )\n            total += entry.size\n\n            parts = entry.path.replace(\"\\\\\", \"/\").split(\"/\")\n            if len(parts) < 2 or any(p in (\"\", \".\", \"..\") for p in parts):\n                raise SkillUploadError(f\"Unsafe upload path: {entry.path!r}\")\n            if entry.path.startswith(\"/\"):\n                raise SkillUploadError(f\"Unsafe upload path: {entry.path!r}\")\n            roots.add(parts[0])\n\n        if total > MAX_TOTAL_BYTES:\n            raise SkillUploadError(\n                f\"The upload is {total} bytes, over the \"\n                f\"{MAX_TOTAL_BYTES}-byte limit.\",\n            )\n        if len(roots) != 1:\n            raise SkillUploadError(\n                f\"A skill must be a single folder, got {sorted(roots)}.\",\n            )\n\n        root = roots.pop()\n        if not any(e.path == f\"{root}/SKILL.md\" for e in manifest.entries):\n            raise SkillUploadError(f\"No SKILL.md at the root of {root!r}.\")\n        return root\n\n    async def install_skill(\n        self,\n        workspace: WorkspaceBase,\n        stream: AsyncIterator[bytes],\n        archive_format: Literal[\"zip\", \"tar\", \"tar.gz\"],","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/app/_service/_workspace.py#L380-L416","documentation":"SkillUploadError raised when the summed entry.size values exceed MAX_TOTAL_BYTES (500 MiB). After per-file checks pass, validate_manifest totals the declared sizes and enforces the archive-wide ceiling that bounds sandbox disk and install-slot hold time.","triggerScenarios":"Uploading a skill whose declared contents total more than 500 MiB — many moderately large assets (models, media, datasets) accumulating past the cap.","commonSituations":"Shipping weights or media alongside code; growing skill repos that creep past the limit over time; forgetting that the total counts all files, not just code.","solutions":["Audit the folder's total size and prune or externalize the largest assets to object storage linked from SKILL.md.","Apply the same SKIP-list/exclusion approach as for file count (node_modules, build artifacts).","If genuinely needed, negotiate a higher MAX_TOTAL_BYTES on the server."],"exampleFix":"# before\ntotal = sum(s for _, s in files)\n\n# after\nMAX_TOTAL = 500 * 1024 * 1024\ntotal = sum(s for _, s in files)\nif total > MAX_TOTAL:\n    raise ValueError(f\"Skill too large: {total} bytes; externalize large assets\")","handlingStrategy":"validation","validationCode":"MAX_TOTAL = 500 * 1024 * 1024\ntotal = sum(e.size for e in manifest.entries)\nif total > MAX_TOTAL:\n    raise ValueError(f\"Total {total} bytes exceeds {MAX_TOTAL}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Show cumulative size in the upload UI.","Keep skills code-only; externalize weights and media."],"tags":["upload","limit","total-size","skill"],"backgroundTag":"upload-limit-exceeded","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}