BigPizzaV3/CodexPlusPlus · error

theme.json.art.{key} 无效

Error message

theme.json.art.{key} 无效

What it means

Thrown by validate_theme_art when optional focusX or focusY is present but is not a finite number in [0.0, 1.0] (the normalized focal-point coordinates the renderer expects). The offending input is theme.json.art's {key} field; omission is allowed, an out-of-range or non-numeric value is not.

Source

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

    rest[1..3].parse::<u32>().is_ok_and(|hour| hour <= 23)
        && rest[4..6].parse::<u32>().is_ok_and(|minute| minute <= 59)
}

fn validate_theme_art(value: &Value) -> anyhow::Result<()> {
    let object = value.as_object().context("theme.json.art 必须是对象")?;
    if object
        .keys()
        .any(|key| !matches!(key.as_str(), "focusX" | "focusY" | "safeArea" | "taskMode"))
    {
        bail!("theme.json.art 包含不支持的字段");
    }
    for key in ["focusX", "focusY"] {
        if object.get(key).is_some_and(|value| {
            value
                .as_f64()
                .is_none_or(|number| !number.is_finite() || !(0.0..=1.0).contains(&number))
        }) {
            bail!("theme.json.art.{key} 无效");
        }
    }
    if object.get("safeArea").is_some_and(|value| {
        value
            .as_str()
            .is_none_or(|value| !matches!(value, "left" | "right" | "none"))
    }) || object.get("taskMode").is_some_and(|value| {
        value
            .as_str()
            .is_none_or(|value| !matches!(value, "ambient" | "full" | "off"))
    }) {
        bail!("theme.json.art 枚举值无效");
    }
    Ok(())
}

fn valid_theme_color(value: &str) -> bool {
    if let Some(hex) = value.strip_prefix('#') {

View on GitHub (pinned to f2074595a2)

Solutions

  1. 把 focusX/focusY 改为 0.0 到 1.0 之间的有限数
Defensive patterns

Strategy: validation

When it happens

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