BigPizzaV3/CodexPlusPlus · error · anyhow::Error

invalid Dream Skin theme id

Error message

invalid Dream Skin theme id

What it means

Generic guard at the top of load_stored_dream_skin_theme: the theme id argument failed valid_theme_id (format/safety check), so it cannot be used to build a safe directory path. The offending input is the id string passed by the caller (UI, import, or rename flow).

Source

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

    })();
    if let Err(error) = staged {
        let _ = remove_known_theme_directory(&staging);
        return Err(error);
    }
    if let Err(error) = replace_theme_directory(&staging, &target, &suffix) {
        let _ = remove_known_theme_directory(&staging);
        return Err(error);
    }
    let stored = load_stored_dream_skin_theme(state_dir, &config.id)?;
    Ok(summary_from_draft(&stored, false, false))
}

pub fn load_stored_dream_skin_theme(
    state_dir: &Path,
    id: &str,
) -> anyhow::Result<DreamSkinThemeDraft> {
    if !valid_theme_id(id) {
        bail!("invalid Dream Skin theme id");
    }
    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 {

View on GitHub (pinned to f2074595a2)

Solutions

  1. Pass a theme id that passed validation when the theme was created
  2. Avoid hand-editing theme ids or constructing them from user input
  3. List existing themes to get a valid id
Defensive patterns

Strategy: validation

When it happens

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