Hmbown/CodeWhale · error

bundle exceeds the {MAX_BUNDLE_FILES} file limit

Error message

bundle exceeds the {MAX_BUNDLE_FILES} file limit

What it means

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.

Source

Thrown at crates/tui/src/plugins/install/stage.rs:165

        let entry = entry?;
        let path = entry.path();
        let metadata = fs::symlink_metadata(&path)?;
        if metadata.file_type().is_symlink() {
            return Err(PluginInstallError::SymlinkRejected.into());
        }
        let name = entry.file_name();
        if name == std::ffi::OsStr::new(INSTALLED_FROM_MARKER) {
            continue;
        }
        let target = dest.join(&name);
        if metadata.is_dir() {
            fs::create_dir(&target)
                .with_context(|| format!("failed to create {}", target.display()))?;
            copy_bundle_regular_files(&path, &target, max_size, budget)?;
        } else if metadata.is_file() {
            budget.files = budget.files.saturating_add(1);
            if budget.files > MAX_BUNDLE_FILES {
                bail!("bundle exceeds the {MAX_BUNDLE_FILES} file limit");
            }
            budget.bytes = budget.bytes.saturating_add(metadata.len());
            if budget.bytes > max_size {
                return Err(PluginInstallError::OversizedBundle { limit: max_size }.into());
            }
            fs::copy(&path, &target).with_context(|| {
                format!("failed to copy {} to {}", path.display(), target.display())
            })?;
        }
    }
    Ok(())
}

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Reduce the file count of the plugin bundle
  2. Or obtain a slimmer bundle from the plugin author
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/plugins/install/stage.rs:165 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/aa1ad9a6edb87c15. Report an issue: GitHub.