BigPizzaV3/CodexPlusPlus · error · anyhow::Error

Dream Skin theme id does not match directory

Error message

Dream Skin theme id does not match directory

What it means

Integrity guard in load_stored_dream_skin_theme: the parsed theme.json's config id does not match the directory name it was loaded from, so the stored theme is internally inconsistent and is rejected to prevent id/directory confusion.

Source

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

    }
    let directory = state_dir.join(THEMES_DIR).join(id);
    let metadata = std::fs::symlink_metadata(&directory)
        .with_context(|| format!("Dream Skin theme not found: {id}"))?;
    if !metadata.file_type().is_dir() || metadata.file_type().is_symlink() {
        bail!("Dream Skin theme path is not a safe directory");
    }
    let config_path = directory.join(THEME_CONFIG_FILE);
    let metadata = std::fs::symlink_metadata(&config_path)
        .with_context(|| format!("Dream Skin theme config not found: {id}"))?;
    if !metadata.file_type().is_file()
        || metadata.file_type().is_symlink()
        || metadata.len() > THEME_CONFIG_LIMIT
    {
        bail!("invalid Dream Skin theme config");
    }
    let config: DreamSkinThemeConfig = serde_json::from_slice(&std::fs::read(&config_path)?)?;
    if config.id != id {
        bail!("Dream Skin theme id does not match directory");
    }
    let image = find_theme_image(&directory)
        .ok_or_else(|| anyhow::anyhow!("Dream Skin theme must contain exactly one image"))?;
    let draft = DreamSkinThemeDraft {
        config,
        image_path: image.to_string_lossy().into_owned(),
        builtin: false,
    };
    validate_theme_draft(&draft)?;
    Ok(draft)
}

pub fn rename_dream_skin_theme(
    state_dir: &Path,
    id: &str,
    name: &str,
) -> anyhow::Result<DreamSkinThemeSummary> {
    let mut draft = load_stored_dream_skin_theme(state_dir, id)?;

View on GitHub (pinned to f2074595a2)

Solutions

  1. Rename the directory or fix theme.json so ids match, or reinstall the theme
  2. Avoid manually renaming theme directories
  3. Re-import the theme from its original package
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/codex-plus-core/src/dream_skin_library.rs:390 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/66c84b2cc2b32be7. Report an issue: GitHub.