BigPizzaV3/CodexPlusPlus · error · anyhow::Error

current Dream Skin theme cannot be deleted

Error message

current Dream Skin theme cannot be deleted

What it means

Guard in delete_dream_skin_theme: the requested theme id equals the currently active theme, so deleting it would leave the active slot dangling. Deletion is refused; the user must activate another theme first.

Source

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

                .with_context(|| format!("failed to remove old image {}", path.display()))?;
        }
    }
    Ok(DreamSkinActivation {
        config: draft.config.clone(),
        active_image_path: active_image.to_string_lossy().into_owned(),
    })
}

pub fn delete_dream_skin_theme(
    state_dir: &Path,
    id: &str,
    active_id: Option<&str>,
) -> anyhow::Result<()> {
    if !valid_theme_id(id) {
        bail!("invalid Dream Skin theme id");
    }
    if active_id.is_some_and(|active| active == id) {
        bail!("current Dream Skin theme cannot be deleted");
    }
    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 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");
    }

View on GitHub (pinned to f2074595a2)

Solutions

  1. Activate a different theme before deleting this one
  2. Choose a non-active theme in the delete UI
  3. No repair needed; the refusal is intended behavior
Defensive patterns

Strategy: validation

When it happens

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