{"record":{"id":"4df885d17340e8b3","repo":"BigPizzaV3/CodexPlusPlus","slug":"built-in-dream-skin-theme-is-read-only","errorCode":null,"errorMessage":"built-in Dream Skin theme is read-only","messagePattern":"built-in Dream Skin theme is read-only","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_library.rs","lineNumber":512,"sourceCode":"    if active_id.is_some_and(|active| active == id) {\n        bail!(\"current Dream Skin theme cannot be deleted\");\n    }\n    let directory = state_dir.join(THEMES_DIR).join(id);\n    let metadata = std::fs::symlink_metadata(&directory)\n        .with_context(|| format!(\"Dream Skin theme not found: {id}\"))?;\n    if !metadata.file_type().is_dir() || metadata.file_type().is_symlink() {\n        bail!(\"Dream Skin theme path is not a safe directory\");\n    }\n    let stored = load_stored_dream_skin_theme(state_dir, id)?;\n    if stored.config.id == DreamSkinThemeConfig::default().id {\n        bail!(\"built-in Dream Skin theme cannot be deleted\");\n    }\n    remove_known_theme_directory(&directory)\n}\n\nfn validate_theme_draft(draft: &DreamSkinThemeDraft) -> anyhow::Result<()> {\n    if draft.builtin {\n        bail!(\"built-in Dream Skin theme is read-only\");\n    }\n    if !valid_theme_id(&draft.config.id) {\n        bail!(\"invalid Dream Skin theme id\");\n    }\n    if draft.config.schema_version != 1 {\n        bail!(\"unsupported Dream Skin theme schema\");\n    }\n    if draft.config.name.trim().is_empty() {\n        bail!(\"Dream Skin theme name is empty\");\n    }\n    if !draft.config.style_preset.is_empty() && !valid_theme_id(&draft.config.style_preset) {\n        bail!(\"invalid Dream Skin style preset\");\n    }\n    if let Some(colors) = &draft.config.colors {\n        for color in [\n            &colors.background,\n            &colors.panel,\n            &colors.panel_alt,","sourceCodeStart":494,"sourceCodeEnd":530,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_library.rs#L494-L530","documentation":"Generic guard in validate_theme_draft: fired when an operation targets the built-in default Dream Skin theme with a mutating draft — built-in themes are immutable, so saves/overrides on them are rejected. The offending input is a draft whose config.id equals the default theme's id.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_library.rs:512 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Duplicate the built-in theme under a new id and edit the copy","Do not overwrite or modify built-in themes","Restore default state if the built-in theme was corrupted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}