BigPizzaV3/CodexPlusPlus · error

Dream Skin theme backup belongs to a different config.toml

Error message

Dream Skin theme backup belongs to a different config.toml

What it means

While applying the Dream Skin base theme, apply_base_theme checks the existing backup file's recorded config.toml identity against the config it is about to modify. If the backup was created for a different config.toml path and that other path still exists (BackupIdentity::DifferentExisting), the library refuses to touch either file to avoid clobbering another Codex home's theme state, and throws this error instead.

Solutions

  1. Point the sync at the codex home the backup was made for (the path recorded in the backup JSON's config_path field), apply/restore there, then retry.
  2. If the old config.toml recorded in the backup is no longer needed, delete/rename that old config file so the backup becomes 'Stale' (which is auto-isolated) and retry.
  3. Manually move or remove the stale backup file in the state dir (dream-skin theme backup JSON) after confirming it is not needed, then re-run apply to create a fresh backup.
  4. Run with enabled=false (restore_base_theme) against the matching home to restore and delete the backup before applying to a new home.

Example fix

// before: backup.config_path = "/Users/old/.codex/config.toml" but applying to /Users/new/.codex/config.toml
sync_dream_skin_base_theme_in_home(&new_home, &state_dir, true, &theme)?; // errors
// after: restore against the original home first, then apply to the new one
sync_dream_skin_base_theme_in_home(&old_home, &state_dir, false, &theme)?;
sync_dream_skin_base_theme_in_home(&new_home, &state_dir, true, &theme)?;
Defensive patterns

Strategy: validation

Validate before calling

use std::fs;
fn backup_matches_home(state_dir: &std::path::Path, config_path: &std::path::Path) -> bool {
    let p = state_dir.join("dream-skin-theme-backup.json");
    let Ok(bytes) = fs::read(&p) else { return true };
    serde_json::from_slice::<serde_json::Value>(&bytes)
        .ok()
        .and_then(|v| v.get("config_path")?.as_str().map(str::to_string))
        .map(|recorded| {
            let recorded = fs::canonicalize(&recorded).ok();
            let current = fs::canonicalize(config_path).ok();
            recorded.is_none() || recorded == current
        })
        .unwrap_or(true)
}

Type guard

fn is_safe_to_apply(backup: &DreamSkinThemeBackup, config_path: &Path) -> bool {
    let recorded = Path::new(&backup.config_path);
    !recorded.exists() || normalized(recorded) == normalized(config_path)
}

Prevention

When it happens

Trigger: Calling sync_dream_skin_base_theme_in_home (enabled=true -> apply_base_theme) when state_dir already contains a Dream Skin theme backup whose stored config_path points to a different config.toml that still exists on disk. E.g. applying theme for home A while the backup was written for home B, or after the CODEX_HOME/config.toml location changed while the old one remains.

Common situations: Switching between multiple CODEX_HOME directories with a shared app state dir; moving/renaming the config.toml (e.g. migrated to a new machine layout) while the old config still exists; running the manager for one profile while a backup made under another profile's home lingers; backup file copied manually between machines.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


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

Appendix: source

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

}

fn apply_base_theme(
    config_path: &Path,
    backup_path: &Path,
    theme: &DreamSkinThemeConfig,
) -> anyhow::Result<()> {
    let existing = read_config_or_empty(config_path)?;
    let mut document = parse_config(&existing, config_path)?;
    let desktop_existed = document.get("desktop").is_some();

    if backup_path.exists() {
        match backup_identity(backup_path, config_path)? {
            BackupIdentity::Same => {}
            BackupIdentity::Stale => {
                isolate_stale_backup(backup_path)?;
            }
            BackupIdentity::DifferentExisting => {
                bail!("Dream Skin theme backup belongs to a different config.toml");
            }
        }
    }
    if !backup_path.exists() {
        let values = APPEARANCE_KEYS
            .iter()
            .map(|key| {
                let item = document
                    .get("desktop")
                    .and_then(Item::as_table)
                    .and_then(|desktop| desktop.get(key))
                    .map(serialize_item);
                ((*key).to_string(), item)
            })
            .collect();
        let backup = DreamSkinThemeBackup {
            schema_version: BACKUP_SCHEMA_VERSION,
            config_path: normalized_config_identity(config_path),

View on GitHub (pinned to b1ed92e5e4)