BigPizzaV3/CodexPlusPlus · error · anyhow::Error

built-in Dream Skin theme cannot be deleted

Error message

built-in Dream Skin theme cannot be deleted

What it means

Guard in delete_dream_skin_theme: the target theme directory is not a regular directory (symlink or special file), so deleting it could remove something outside the themes root. Deletion is refused as a path-safety measure.

Source

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

    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");
    }
    if !valid_theme_id(&draft.config.id) {
        bail!("invalid Dream Skin theme id");
    }
    if draft.config.schema_version != 1 {
        bail!("unsupported Dream Skin theme schema");
    }
    if draft.config.name.trim().is_empty() {
        bail!("Dream Skin theme name is empty");
    }
    if !draft.config.style_preset.is_empty() && !valid_theme_id(&draft.config.style_preset) {

View on GitHub (pinned to f2074595a2)

Solutions

  1. Remove the symlink/special file manually after verifying it is safe
  2. Check the state dir for tampering or sync-tool artifacts
  3. Reinstall the theme to restore a proper directory
Defensive patterns

Strategy: validation

When it happens

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