BigPizzaV3/CodexPlusPlus · error · anyhow::Error

主题市场清单超过 {} 项限制

Error message

主题市场清单超过 {} 项限制

What it means

Validation guard in validate_manifest: the market manifest lists more themes than MARKET_THEME_COUNT_LIMIT allows. This caps manifest size to bound memory and UI cost; an oversized manifest is treated as untrusted or corrupt.

Source

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

        theme.installed = local_theme.is_file();
        theme.installed_version = if theme.installed {
            records.themes.get(&theme.id).cloned().unwrap_or_default()
        } else {
            String::new()
        };
        theme.update_available = theme.installed
            && !theme.installed_version.is_empty()
            && theme.installed_version != theme.version;
    }
    manifest
}

fn validate_manifest(manifest: &mut DreamSkinMarketManifest) -> anyhow::Result<()> {
    if manifest.schema_version != 1 {
        bail!("不支持的主题市场清单版本");
    }
    if manifest.themes.len() > MARKET_THEME_COUNT_LIMIT {
        bail!("主题市场清单超过 {} 项限制", MARKET_THEME_COUNT_LIMIT);
    }
    let mut ids = HashSet::new();
    for theme in &mut manifest.themes {
        validate_market_theme(theme)?;
        if !ids.insert(theme.id.clone()) {
            bail!("主题市场清单包含重复 ID:{}", theme.id);
        }
        theme.preview_url = market_asset_url(DEFAULT_MARKET_RAW_BASE_URL, &theme.preview)?;
    }
    Ok(())
}

fn validate_market_theme(theme: &DreamSkinMarketTheme) -> anyhow::Result<()> {
    if !valid_theme_id(&theme.id) {
        bail!("主题市场包含无效 ID:{}", theme.id);
    }
    for (label, value, limit) in [
        ("名称", theme.name.as_str(), 100usize),

View on GitHub (pinned to f2074595a2)

Solutions

  1. Use a trimmed manifest within the theme count limit
  2. Check whether the market server is serving an unexpectedly large or wrong manifest
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_market.rs:190 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/458f1eeae9b8613e. Report an issue: GitHub.