BigPizzaV3/CodexPlusPlus · error

主题包文件 {name} 超过大小限制

Error message

主题包文件 {name} 超过大小限制

What it means

Per-file size guard in validate_and_read_package: after reading an entry with a limit+1 cap, the content is empty or exceeds the per-file limit assigned by file_limit(base_name). Each allowed file type has its own maximum; oversize files are rejected to bound unpacked size.

Source

Thrown at crates/codex-plus-core/src/dream_skin_package.rs:129

        if file.is_dir() {
            entries.push((name, None));
            continue;
        }
        let base_name = name.rsplit('/').next().unwrap_or_default();
        if base_name == ".DS_Store" || name.starts_with("__MACOSX/") {
            entries.push((name, None));
            continue;
        }
        if !ALLOWED_FILES.contains(&base_name) {
            bail!("主题包包含不支持的文件:{name}");
        }
        let limit = file_limit(base_name);
        let mut content = Vec::new();
        file.take((limit + 1) as u64)
            .read_to_end(&mut content)
            .context("读取 Dream Skin ZIP 内容失败")?;
        if content.is_empty() || content.len() > limit {
            bail!("主题包文件 {name} 超过大小限制");
        }
        unpacked = unpacked.saturating_add(content.len());
        if unpacked > UNPACKED_LIMIT {
            bail!("Dream Skin 主题包解包后超过 64 MiB 限制");
        }
        entries.push((name, Some(content)));
    }

    let mut files = normalize_package_entries(entries)?;

    let manifest_bytes = files
        .remove("manifest.json")
        .context("主题包缺少 manifest.json")?;
    let theme_bytes = files
        .remove("theme.json")
        .context("主题包缺少 theme.json")?;
    let css_bytes = files.remove("theme.css").context("主题包缺少 theme.css")?;
    let image_name = ["background.webp", "background.jpg", "background.png"]

View on GitHub (pinned to f2074595a2)

Solutions

  1. Shrink the named file (compress the image, minify CSS/JSON)
  2. Ensure the file is non-empty and within its per-type size limit
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_package.rs:129 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/630eafa27fec7c96. Report an issue: GitHub.