{"record":{"id":"0d14b955961f3719","repo":"BigPizzaV3/CodexPlusPlus","slug":"dream-skin-image-is-not-managed-by-codex","errorCode":null,"errorMessage":"Dream Skin image is not managed by Codex++","messagePattern":"Dream Skin image is not managed by Codex\\+\\+","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/codex-plus-manager/src-tauri/src/commands.rs","lineNumber":2389,"sourceCode":"        runtime: codex_plus_core::dream_skin_runtime::dream_skin_status(debug_port).await,\n        saved_for_next_launch: false,\n    }\n}\n\nfn empty_dream_skin_image_payload() -> DreamSkinImagePayload {\n    DreamSkinImagePayload {\n        path: String::new(),\n        content_type: String::new(),\n        size_bytes: 0,\n    }\n}\n\nfn managed_dream_skin_image_backup(\n    path: &Path,\n    state_dir: &Path,\n) -> anyhow::Result<ManagedDreamSkinImageBackup> {\n    if !codex_plus_core::dream_skin::is_managed_dream_skin_image(path, state_dir) {\n        anyhow::bail!(\"Dream Skin image is not managed by Codex++\");\n    }\n    Ok(ManagedDreamSkinImageBackup {\n        path: path.to_path_buf(),\n        bytes: fs::read(path)?,\n    })\n}\n\nfn restore_managed_dream_skin_image_backup(\n    backup: ManagedDreamSkinImageBackup,\n) -> anyhow::Result<()> {\n    codex_plus_core::settings::atomic_write(&backup.path, &backup.bytes)\n}\n\nfn dream_skin_content_type(path: &Path) -> &'static str {\n    match path\n        .extension()\n        .and_then(|extension| extension.to_str())\n        .map(str::to_ascii_lowercase)","sourceCodeStart":2371,"sourceCodeEnd":2407,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/apps/codex-plus-manager/src-tauri/src/commands.rs#L2371-L2407","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Point the operation at the original Dream Skin image path inside the managed state directory","Reinstall/re-apply the Dream Skin asset so it is re-registered as managed, then retry","Verify the state_dir passed to the command matches the one used when the image was installed"],"exampleFix":"// before\nbackup_image(userPickedPath);\n// after\nif (!isManagedDreamSkinImage(p, stateDir)) throw new Error(\"choose the managed dream skin image\");\nbackup_image(p);","handlingStrategy":"validation","validationCode":"if (!isManagedDreamSkinImagePath(path, stateDir)) throw new Error('path is not a managed dream skin image');","typeGuard":null,"tryCatchPattern":"try { await invoke('dream_skin_backup_image', { path }) } catch (e) { if (String(e).includes('not managed')) showManagedPathHint(); }","preventionTips":["Only pass paths previously returned by the Dream Skin install API","Keep state_dir consistent across sessions","Never let users browse arbitrary images for managed operations"],"tags":["dream-skin","validation","file-management"],"backgroundTag":"resource-not-found","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}