BigPizzaV3/CodexPlusPlus · error

市场主题配置与清单身份不一致

Error message

市场主题配置与清单身份不一致

What it means

After downloading and SHA-256-verifying a market theme, install_market_theme_from_base parses the theme config and checks that its id and name match the marketplace manifest entry being installed. A mismatch means the hosted theme.json does not correspond to the manifest record, so installation is aborted to prevent installing mislabeled or swapped content.

Solutions

  1. Ask the theme publisher to update the market manifest so theme.id/theme.name match the id/name inside the published theme.json (and recompute theme_sha256)
  2. Verify the manifest entry's theme path points at the correct theme.json (not another theme's file)
  3. Retry after the manifest is fixed; if you mirror the market, refresh your mirror from upstream
  4. If you author the theme, keep id/name identical in theme.json and the manifest entry

Example fix

// manifest entry before (mismatch)
{ "id": "cool-theme", "name": "Cool Theme", "theme": "themes/cool-theme/theme.json" } // theme.json contains id: "old-theme"
// after — publish theme.json with matching identity and update sha256
{ "id": "cool-theme", "name": "Cool Theme", "theme": "themes/cool-theme/theme.json", "theme_sha256": "<new hash of theme.json whose id==cool-theme>" }
Defensive patterns

Strategy: try-catch

Validate before calling

// after fetching the manifest entry, before installing, you cannot fully verify without downloading;
// at minimum check the manifest record is internally consistent and pinned by hash:
if theme.theme_sha256.is_empty() || theme.id.is_empty() || theme.name.is_empty() {
    return Err(anyhow::anyhow!("manifest entry missing id/name/hash"));
}

Try / catch

match install_market_theme(state_dir, &theme).await {
    Ok(summary) => println!("installed {}", summary.id),
    Err(e) if e.to_string().contains("身份不一致") => {
        eprintln!("market asset does not match manifest identity — report to the theme publisher and skip this theme");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: The downloaded theme.json has an id or name different from the DreamSkinMarketTheme entry passed to install_market_theme — typically because the market publisher updated/renamed the theme in theme.json without regenerating the manifest hashes/fields, or the manifest points at the wrong asset path.

Common situations: Theme author edits the theme name/id in their repo but forgets to update the market manifest entry; manifest asset paths are stale after a restructure; a mirror serves an outdated theme.json whose hash happens to match an old manifest.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/f0febdba7403b69a. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/dream_skin_market.rs:137

) -> anyhow::Result<DreamSkinThemeSummary> {
    install_market_theme_from_base(state_dir, theme, DEFAULT_MARKET_RAW_BASE_URL).await
}

pub async fn install_market_theme_from_base(
    state_dir: &Path,
    theme: &DreamSkinMarketTheme,
    raw_base_url: &str,
) -> anyhow::Result<DreamSkinThemeSummary> {
    validate_market_theme(theme)?;
    let client = market_http_client()?;
    let theme_url = market_asset_url(raw_base_url, &theme.theme)?;
    let image_url = market_asset_url(raw_base_url, &theme.image)?;
    let theme_bytes = download_limited(&client, &theme_url, MARKET_THEME_LIMIT).await?;
    verify_sha256(&theme_bytes, &theme.theme_sha256, "主题配置")?;
    let config: DreamSkinThemeConfig =
        serde_json::from_slice(&theme_bytes).context("市场主题配置不是有效 JSON")?;
    if config.id != theme.id || config.name != theme.name {
        bail!("市场主题配置与清单身份不一致");
    }

    let image_bytes = download_limited(&client, &image_url, MARKET_IMAGE_LIMIT).await?;
    verify_sha256(&image_bytes, &theme.image_sha256, "主题图片")?;
    let extension =
        detect_image_extension(&image_bytes).context("市场主题图片格式无效或不受支持")?;
    let download_path = market_download_path(state_dir, &theme.id, extension)?;
    crate::settings::atomic_write(&download_path, &image_bytes)
        .with_context(|| format!("无法暂存市场主题图片 {}", download_path.display()))?;

    let draft = DreamSkinThemeDraft {
        config,
        image_path: download_path.to_string_lossy().into_owned(),
        builtin: false,
    };
    let installed = crate::dream_skin_library::save_dream_skin_theme(state_dir, &draft);
    let _ = std::fs::remove_file(&download_path);
    let installed = installed?;

View on GitHub (pinned to b1ed92e5e4)