BigPizzaV3/CodexPlusPlus · error

unsupported Dream Skin theme schema

Error message

unsupported Dream Skin theme schema

What it means

validate_theme_draft requires draft.config.schema_version to equal exactly 1. Any other value (0, 2, missing/defaulted to something else) is rejected so the library never writes theme files in a format it doesn't understand. This is a forward-compatibility guard on the theme config schema.

Solutions

  1. Set draft.config.schema_version = 1 before saving — the currently supported version.
  2. For themes from a newer version, open them in that newer version or migrate the fields back to schema 1 manually before import.
  3. When deserializing, normalize unknown/newer schemas: copy recognized fields into a fresh schema-1 config and drop unknown ones.

Example fix

// before
let mut config: DreamSkinThemeConfig = serde_json::from_str(&imported)?;
config.schema_version = 2; // unsupported
save_dream_skin_theme(&state_dir, &draft(config))?;
// after
let mut config: DreamSkinThemeConfig = serde_json::from_str(&imported)?;
config.schema_version = 1; // only schema 1 is supported
save_dream_skin_theme(&state_dir, &draft(config))?;
Defensive patterns

Strategy: validation

Validate before calling

if draft.config.schema_version != 1 {
    return Err(anyhow!("unsupported schema {} — migrate to 1 first", draft.config.schema_version));
}

Try / catch

match save_dream_skin_theme(&state_dir, &draft) {
    Err(e) if e.to_string().contains("schema") => migrate_or_reject_import(&draft),
    other => other?,
}

Prevention

When it happens

Trigger: Saving or importing a draft whose config.schema_version != 1 — e.g. a theme.json from a newer app version, a hand-edited config with schema_version set to 2, or a struct built without setting the field.

Common situations: Importing themes produced by a newer CodexPlusPlus release; manually bumping schema_version expecting an upgrade path; constructing DreamSkinThemeConfig programmatically with a wrong literal; downgraded app reading upgraded files (rejected at load).

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/d2a8eb3350a3bb36. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/dream_skin_library.rs:518

    if !metadata.file_type().is_dir() || metadata.file_type().is_symlink() {
        bail!("Dream Skin theme path is not a safe directory");
    }
    let stored = load_stored_dream_skin_theme(state_dir, id)?;
    if stored.config.id == DreamSkinThemeConfig::default().id {
        bail!("built-in Dream Skin theme cannot be deleted");
    }
    remove_known_theme_directory(&directory)
}

fn validate_theme_draft(draft: &DreamSkinThemeDraft) -> anyhow::Result<()> {
    if draft.builtin {
        bail!("built-in Dream Skin theme is read-only");
    }
    if !valid_theme_id(&draft.config.id) {
        bail!("invalid Dream Skin theme id");
    }
    if draft.config.schema_version != 1 {
        bail!("unsupported Dream Skin theme schema");
    }
    if draft.config.name.trim().is_empty() {
        bail!("Dream Skin theme name is empty");
    }
    if !draft.config.style_preset.is_empty() && !valid_theme_id(&draft.config.style_preset) {
        bail!("invalid Dream Skin style preset");
    }
    if let Some(colors) = &draft.config.colors {
        for color in [
            &colors.background,
            &colors.panel,
            &colors.panel_alt,
            &colors.accent,
            &colors.accent_alt,
            &colors.secondary,
            &colors.highlight,
            &colors.text,
            &colors.muted,

View on GitHub (pinned to b1ed92e5e4)