{"record":{"id":"a8ed867926f06912","repo":"conductor-oss/conductor","slug":"skill-package-exceeds-max-size-of-maxpackagebytes","errorCode":null,"errorMessage":"Skill package exceeds max size of {maxPackageBytes} bytes","messagePattern":"Skill package exceeds max size of (.+?) bytes","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java","lineNumber":415,"sourceCode":"                .orElseThrow(() -> new IllegalArgumentException(\"Skill not found: \" + name));\n    }\n\n    private Map<String, Object> parseManifest(String manifestJson) {\n        if (manifestJson == null || manifestJson.isBlank()) {\n            throw new IllegalArgumentException(\"Skill manifest is required\");\n        }\n        try {\n            return MAPPER.readValue(manifestJson, MAP_TYPE);\n        } catch (IOException e) {\n            throw new IllegalArgumentException(\"Invalid skill manifest JSON: \" + e.getMessage(), e);\n        }\n    }\n\n    private byte[] readPackage(MultipartFile packageFile) {\n        try {\n            byte[] bytes = packageFile.getBytes();\n            if (bytes.length > maxPackageBytes) {\n                throw new IllegalArgumentException(\n                        \"Skill package exceeds max size of \" + maxPackageBytes + \" bytes\");\n            }\n            return bytes;\n        } catch (IOException e) {\n            throw new IllegalArgumentException(\n                    \"Failed to read skill package: \" + e.getMessage(), e);\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    private ParsedSkillPackage parseSkillPackage(byte[] bytes, Map<String, Object> manifest) {\n        List<SkillFileEntry> files = new ArrayList<>();\n        Map<String, byte[]> contentByPath = new TreeMap<>();\n        long totalUncompressedBytes = 0;\n        try (ZipInputStream zip = new ZipInputStream(new ByteArrayInputStream(bytes))) {\n            ZipEntry entry;\n            while ((entry = zip.getNextEntry()) != null) {\n                if (entry.isDirectory()) {","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/SkillRegistryService.java#L397-L433","documentation":"Thrown by register() (via readPackage) when the uploaded package bytes exceed maxPackageBytes (default 52,428,800 = 50 MiB, configurable via agentspan.skills.max-package-bytes). This is the compressed upload size cap, checked immediately after reading the multipart bytes and before any zip parsing.","triggerScenarios":"POST /api/skills/register with a package zip larger than the configured limit. Fires for any upload over the cap regardless of uncompressed content size.","commonSituations":"Bundling large binaries, datasets, or vendored dependencies into the skill zip; the default 50 MiB limit being lower than a team's package; lowering the limit in a shared config and then uploading previously-valid packages.","solutions":["Reduce the package size: remove large binaries, vendor dirs, or unused assets.","Raise agentspan.skills.max-package-bytes in application config if larger packages are legitimate.","Host large reference data externally and reference it from the skill instead of bundling."],"exampleFix":"# application.yml\nagentspan:\n  skills:\n    max-package-bytes: 104857600  # 100 MiB","handlingStrategy":"validation","validationCode":"// Client-side: check package size before uploading\nlong size = Files.size(packageFile.toPath());\nif (size > maxPackageBytes) { throw new IllegalArgumentException(\"package too large: \" + size); }","typeGuard":"static boolean withinPackageLimit(long size, long maxPackageBytes) { return size <= maxPackageBytes; }","tryCatchPattern":"try { skillRegistryService.register(manifest, pkg); }\ncatch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"exceeds max size\")) { /* shrink package or raise limit */ }\n    else throw e;\n}","preventionTips":["Exclude large binaries and vendored deps from the zip in the build step.","Document the configured max-package-bytes to skill authors."],"tags":["java","conductor","skill-registry","size-limit","validation"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}