BigPizzaV3/CodexPlusPlus · error

theme.json 的链接或外观字段无效

Error message

theme.json 的链接或外观字段无效

What it means

Thrown by validate_theme when optional link/appearance fields are malformed: promoUrl is present but not a string passing the 512-char safe-text check, or appearance is present but not one of auto/light/dark. The offending input is theme.json's promoUrl or appearance field; this guard runs after the per-field display-text loop.

Source

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

    ] {
        if object.get(key).is_some_and(|value| {
            value
                .as_str()
                .is_none_or(|text| !safe_manifest_text(text, 0, 120, false))
        }) {
            bail!("theme.json.{key} 无效");
        }
    }
    if object.get("promoUrl").is_some_and(|value| {
        value
            .as_str()
            .is_none_or(|text| !safe_manifest_text(text, 0, 512, false))
    }) || object.get("appearance").is_some_and(|value| {
        value
            .as_str()
            .is_none_or(|appearance| !matches!(appearance, "auto" | "light" | "dark"))
    }) {
        bail!("theme.json 的链接或外观字段无效");
    }
    if let Some(art) = object.get("art") {
        validate_theme_art(art)?;
    }
    if let Some(colors) = object.get("colors") {
        let colors = colors.as_object().context("theme.json.colors 必须是对象")?;
        let keys = [
            "background",
            "panel",
            "panelAlt",
            "accent",
            "accentAlt",
            "secondary",
            "highlight",
            "text",
            "muted",
            "line",
        ];

View on GitHub (pinned to f2074595a2)

Solutions

  1. 把 promoUrl 控制在 512 字符内
  2. 把 appearance 改为 auto、light 或 dark 之一
Defensive patterns

Strategy: validation

When it happens

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