BigPizzaV3/CodexPlusPlus · error · anyhow::Error

Dream Skin image is not managed by Codex++

Error message

Dream Skin image is not managed by Codex++

What it means

Dream Skin image backup/restore only accepts image files that codex_plus_core::dream_skin::is_managed_dream_skin_image recognizes as managed by Codex++ (located/tracked relative to the state_dir). Any other path passed to managed_dream_skin_image_backup is rejected to prevent backing up or restoring unrelated files.

Solutions

  1. Point the operation at the original Dream Skin image path inside the managed state directory
  2. Reinstall/re-apply the Dream Skin asset so it is re-registered as managed, then retry
  3. Verify the state_dir passed to the command matches the one used when the image was installed

Example fix

// before
backup_image(userPickedPath);
// after
if (!isManagedDreamSkinImage(p, stateDir)) throw new Error("choose the managed dream skin image");
backup_image(p);
Defensive patterns

Strategy: validation

Validate before calling

if (!isManagedDreamSkinImagePath(path, stateDir)) throw new Error('path is not a managed dream skin image');

Try / catch

try { await invoke('dream_skin_backup_image', { path }) } catch (e) { if (String(e).includes('not managed')) showManagedPathHint(); }

Prevention

When it happens

Trigger: Calling the Dream Skin image backup command (commands.rs ~2389) with a path where is_managed_dream_skin_image(path, state_dir) returns false — path outside the managed Dream Skin state directory or not matching managed naming.

Common situations: User picked an arbitrary image from disk; the state_dir was moved or changed so the path no longer resolves as managed; a renamed/moved managed image no longer matches the expected layout.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:2389

        runtime: codex_plus_core::dream_skin_runtime::dream_skin_status(debug_port).await,
        saved_for_next_launch: false,
    }
}

fn empty_dream_skin_image_payload() -> DreamSkinImagePayload {
    DreamSkinImagePayload {
        path: String::new(),
        content_type: String::new(),
        size_bytes: 0,
    }
}

fn managed_dream_skin_image_backup(
    path: &Path,
    state_dir: &Path,
) -> anyhow::Result<ManagedDreamSkinImageBackup> {
    if !codex_plus_core::dream_skin::is_managed_dream_skin_image(path, state_dir) {
        anyhow::bail!("Dream Skin image is not managed by Codex++");
    }
    Ok(ManagedDreamSkinImageBackup {
        path: path.to_path_buf(),
        bytes: fs::read(path)?,
    })
}

fn restore_managed_dream_skin_image_backup(
    backup: ManagedDreamSkinImageBackup,
) -> anyhow::Result<()> {
    codex_plus_core::settings::atomic_write(&backup.path, &backup.bytes)
}

fn dream_skin_content_type(path: &Path) -> &'static str {
    match path
        .extension()
        .and_then(|extension| extension.to_str())
        .map(str::to_ascii_lowercase)

View on GitHub (pinned to b1ed92e5e4)