BigPizzaV3/CodexPlusPlus · error

manifest.files 的 LICENSE.txt 与包内容不一致

Error message

manifest.files 的 LICENSE.txt 与包内容不一致

What it means

Thrown by validate_manifest_files when a LICENSE.txt entry is declared in manifest.files but its recorded hash/size does not match the LICENSE.txt bytes actually present in the package. The offending input is the LICENSE.txt manifest entry vs. the extracted license content; the declared and actual license text disagree.

Source

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

            "background.webp" => "image/webp",
            "background.jpg" => "image/jpeg",
            "background.png" => "image/png",
            "LICENSE.txt" => "text/plain",
            _ => "",
        };
        if file.media_type != expected_media_type {
            bail!("manifest.files 的 mediaType 不匹配:{}", file.path);
        }
        let actual = format!("{:x}", Sha256::digest(bytes));
        if file.bytes != bytes.len() || !actual.eq_ignore_ascii_case(&file.sha256) {
            bail!("manifest.files 的 SHA-256 或大小不匹配:{}", file.path);
        }
    }
    if !seen.contains("theme.json") || !seen.contains("theme.css") || !seen.contains(image_name) {
        bail!("manifest.files 缺少必需文件");
    }
    if seen.contains("LICENSE.txt") != license_bytes.is_some() {
        bail!("manifest.files 的 LICENSE.txt 与包内容不一致");
    }
    Ok(())
}

fn valid_theme_id(value: &str) -> bool {
    let mut chars = value.chars();
    chars.next().is_some_and(|c| c.is_ascii_alphanumeric())
        && value
            .chars()
            .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || matches!(c, '-' | '.'))
}

fn valid_semver(value: &str) -> bool {
    let parts = value.split('.').collect::<Vec<_>>();
    parts.len() == 3
        && value.len() <= 32
        && parts.iter().all(|part| {
            !part.is_empty()

View on GitHub (pinned to f2074595a2)

Solutions

  1. 修改 LICENSE.txt 后同步更新 manifest 中的大小与 SHA-256
  2. 或从 files 清单中移除 LICENSE.txt 条目
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_package.rs:1140 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/730c99e826f3312b. Report an issue: GitHub.