{"record":{"id":"aa1ad9a6edb87c15","repo":"Hmbown/CodeWhale","slug":"bundle-exceeds-the-max-bundle-files-file-limit","errorCode":null,"errorMessage":"bundle exceeds the {MAX_BUNDLE_FILES} file limit","messagePattern":"bundle exceeds the (.+?) file limit","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/plugins/install/stage.rs","lineNumber":165,"sourceCode":"        let entry = entry?;\n        let path = entry.path();\n        let metadata = fs::symlink_metadata(&path)?;\n        if metadata.file_type().is_symlink() {\n            return Err(PluginInstallError::SymlinkRejected.into());\n        }\n        let name = entry.file_name();\n        if name == std::ffi::OsStr::new(INSTALLED_FROM_MARKER) {\n            continue;\n        }\n        let target = dest.join(&name);\n        if metadata.is_dir() {\n            fs::create_dir(&target)\n                .with_context(|| format!(\"failed to create {}\", target.display()))?;\n            copy_bundle_regular_files(&path, &target, max_size, budget)?;\n        } else if metadata.is_file() {\n            budget.files = budget.files.saturating_add(1);\n            if budget.files > MAX_BUNDLE_FILES {\n                bail!(\"bundle exceeds the {MAX_BUNDLE_FILES} file limit\");\n            }\n            budget.bytes = budget.bytes.saturating_add(metadata.len());\n            if budget.bytes > max_size {\n                return Err(PluginInstallError::OversizedBundle { limit: max_size }.into());\n            }\n            fs::copy(&path, &target).with_context(|| {\n                format!(\"failed to copy {} to {}\", path.display(), target.display())\n            })?;\n        }\n    }\n    Ok(())\n}\n","sourceCodeStart":147,"sourceCodeEnd":178,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/plugins/install/stage.rs#L147-L178","documentation":"Bundle copy accounting in copy_bundle_regular_files exceeded MAX_BUNDLE_FILES entries. Together with the size cap this bounds installation cost and blocks zip-bomb-style bundles; the copy is aborted partway rather than completed.","triggerScenarios":"Thrown at crates/tui/src/plugins/install/stage.rs:165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the file count of the plugin bundle","Or obtain a slimmer bundle from the plugin author"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}