BigPizzaV3/CodexPlusPlus · error · anyhow::Error

unsupported Dream Skin backup schema

Error message

unsupported Dream Skin backup schema

What it means

parse_backup_item dispatches on backup.schema_version: 1 takes the legacy TOML-value parser, BACKUP_SCHEMA_VERSION the current document parser; anything else bails. In the shipped call paths read_backup has already enforced the same set, so this is the defensive backstop for callers that hand-construct a DreamSkinThemeBackup.

Source

Thrown at crates/codex-plus-core/src/dream_skin.rs:474

    theme.insert("fonts", Value::InlineTable(fonts));
    theme.insert("ink", profile.ink.into());
    theme.insert("opaqueWindows", profile.opaque_windows.into());
    theme.insert("semanticColors", Value::InlineTable(semantic_colors));
    theme.insert("surface", profile.surface.into());
    theme
}

fn serialize_item(item: &Item) -> String {
    let mut document = DocumentMut::new();
    document["value"] = item.clone();
    document.to_string()
}

fn parse_backup_item(backup: &DreamSkinThemeBackup, serialized: &str) -> anyhow::Result<Item> {
    match backup.schema_version {
        1 => parse_legacy_item(serialized),
        BACKUP_SCHEMA_VERSION => parse_document_item(serialized),
        _ => bail!("unsupported Dream Skin backup schema"),
    }
}

fn parse_legacy_item(serialized: &str) -> anyhow::Result<Item> {
    match format!("value = {serialized}\n").parse::<DocumentMut>() {
        Ok(mut document) => document
            .remove("value")
            .context("serialized Dream Skin backup value is missing"),
        Err(_) => parse_legacy_table(serialized),
    }
}

fn parse_legacy_table(serialized: &str) -> anyhow::Result<Item> {
    let document = serialized.parse::<DocumentMut>()?;
    Ok(Item::Table(document.as_table().clone()))
}

fn parse_document_item(serialized: &str) -> anyhow::Result<Item> {

View on GitHub (pinned to f2074595a2)

Solutions

  1. Reinstall the app version that understands the backup's schema, or a newer one
  2. Delete the backup file to reset Dream Skin state
  3. File an issue including the schema_version value from the backup JSON
Defensive patterns

Strategy: try-catch

Validate before calling

fn backup_schema_version(path: &std::path::Path) -> Option<u64> {
    let bytes = std::fs::read(path).ok()?;
    serde_json::from_slice::<serde_json::Value>(&bytes)
        .ok()?
        .get("schema_version")?
        .as_u64()
}

Try / catch

Match the 'unsupported Dream Skin backup schema' message, read schema_version from the backup JSON, and tell the user whether their app is older or newer than the backup; offer deleting the backup as the reset path.

Prevention

When it happens

Trigger: A backup written by a newer app reaching an older parser without read_backup's gate; unit tests or custom tooling constructing a backup struct with an arbitrary schema_version.

Common situations: Downgrade after an upgrade wrote a next-schema backup; direct struct-level use of the API in tests.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@f2074595a2 (2026-08-23). Data as JSON: /api/errors/4ac8c8c5902c3d18. Report an issue: GitHub.