{"record":{"id":"f5e92c5d1b6e882e","repo":"BigPizzaV3/CodexPlusPlus","slug":"invalid-dream-skin-theme-id","errorCode":null,"errorMessage":"invalid Dream Skin theme id","messagePattern":"invalid Dream Skin theme id","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_library.rs","lineNumber":371,"sourceCode":"    })();\n    if let Err(error) = staged {\n        let _ = remove_known_theme_directory(&staging);\n        return Err(error);\n    }\n    if let Err(error) = replace_theme_directory(&staging, &target, &suffix) {\n        let _ = remove_known_theme_directory(&staging);\n        return Err(error);\n    }\n    let stored = load_stored_dream_skin_theme(state_dir, &config.id)?;\n    Ok(summary_from_draft(&stored, false, false))\n}\n\npub fn load_stored_dream_skin_theme(\n    state_dir: &Path,\n    id: &str,\n) -> anyhow::Result<DreamSkinThemeDraft> {\n    if !valid_theme_id(id) {\n        bail!(\"invalid Dream Skin theme id\");\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 config_path = directory.join(THEME_CONFIG_FILE);\n    let metadata = std::fs::symlink_metadata(&config_path)\n        .with_context(|| format!(\"Dream Skin theme config not found: {id}\"))?;\n    if !metadata.file_type().is_file()\n        || metadata.file_type().is_symlink()\n        || metadata.len() > THEME_CONFIG_LIMIT\n    {\n        bail!(\"invalid Dream Skin theme config\");\n    }\n    let config: DreamSkinThemeConfig = serde_json::from_slice(&std::fs::read(&config_path)?)?;\n    if config.id != id {","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_library.rs#L353-L389","documentation":"Generic guard at the top of load_stored_dream_skin_theme: the theme id argument failed valid_theme_id (format/safety check), so it cannot be used to build a safe directory path. The offending input is the id string passed by the caller (UI, import, or rename flow).","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_library.rs:371 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a theme id that passed validation when the theme was created","Avoid hand-editing theme ids or constructing them from user input","List existing themes to get a valid id"],"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"}