BigPizzaV3/CodexPlusPlus · error

theme.json.art 包含不支持的字段

Error message

theme.json.art 包含不支持的字段

What it means

Thrown by validate_theme_art when the art object contains any key other than the whitelist focusX/focusY/safeArea/taskMode. This is a strict-schema guard on untrusted theme JSON: the offending input is the key set of theme.json.art; unknown art keys abort validation instead of being silently ignored.

Source

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

        rest = &fraction[digits..];
    }
    if rest == "Z" {
        return true;
    }
    if rest.len() != 6 || !matches!(rest.as_bytes()[0], b'+' | b'-') || rest.as_bytes()[3] != b':' {
        return false;
    }
    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"))

View on GitHub (pinned to f2074595a2)

Solutions

  1. 删除 art 中不支持的自定义键
Defensive patterns

Strategy: validation

When it happens

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