BigPizzaV3/CodexPlusPlus · error · anyhow::Error

主题市场包含无效 ID:{}

Error message

主题市场包含无效 ID:{}

What it means

Validation guard in validate_market_theme: the theme id fails valid_theme_id — must be 1-64 bytes, start alphanumeric, and contain only lowercase letters, digits, '-' or '_'. Fires on a manifest entry whose id is empty, too long, or contains uppercase/other characters, since ids are used as directory and file names.

Source

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

        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),
        ("版本", theme.version.as_str(), 40usize),
        ("作者", theme.author.as_str(), 100usize),
        ("许可证", theme.license.as_str(), 100usize),
    ] {
        if value.trim().is_empty() || value.len() > limit {
            bail!("市场主题 {} 的{}无效", theme.id, label);
        }
    }
    if theme.description.len() > 500 || theme.tags.len() > 12 {
        bail!("市场主题 {} 的描述或标签数量超过限制", theme.id);
    }
    if theme
        .tags
        .iter()
        .any(|tag| tag.trim().is_empty() || tag.len() > 32)

View on GitHub (pinned to f2074595a2)

Solutions

  1. Fix the theme id in the market manifest to match the allowed id format
  2. Skip or report the offending market theme
Defensive patterns

Strategy: validation

When it happens

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