{"record":{"id":"c0defb3f96de1057","repo":"BigPizzaV3/CodexPlusPlus","slug":"dream-skin-theme-config-exceeds-256-kib","errorCode":null,"errorMessage":"Dream Skin theme config exceeds 256 KiB","messagePattern":"Dream Skin theme config exceeds 256 KiB","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_library.rs","lineNumber":283,"sourceCode":"            \"failed to create theme staging directory {}\",\n            staging.display()\n        )\n    })?;\n\n    let staged = (|| -> anyhow::Result<()> {\n        if draft.image_path.trim().is_empty() {\n            let (_, bytes) = crate::assets::dream_skin_default_image();\n            crate::settings::atomic_write(&staging.join(\"image.png\"), bytes)?;\n        } else {\n            crate::dream_skin::prepare_dream_skin_image_for_directory(\n                Path::new(draft.image_path.trim()),\n                &staging,\n                \"image\",\n            )?;\n        }\n        let config = serde_json::to_vec_pretty(&draft.config)?;\n        if config.len() as u64 > THEME_CONFIG_LIMIT {\n            bail!(\"Dream Skin theme config exceeds 256 KiB\");\n        }\n        crate::settings::atomic_write(&staging.join(THEME_CONFIG_FILE), &config)?;\n        Ok(())\n    })();\n    if let Err(error) = staged {\n        let _ = remove_known_theme_directory(&staging);\n        return Err(error);\n    }\n\n    let target = themes_dir.join(&draft.config.id);\n    replace_theme_directory(&staging, &target, &suffix)?;\n    let stored = load_stored_dream_skin_theme(state_dir, &draft.config.id)?;\n    Ok(summary_from_draft(&stored, false, false))\n}\n\npub fn save_validated_dream_skin_package(\n    state_dir: &Path,\n    package: &crate::dream_skin_package::ValidatedDreamSkinPackage,","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_library.rs#L265-L301","documentation":"Size guard in save_dream_skin_theme: the serialized theme.json for a Dream Skin theme exceeds 256 KiB, so it would bloat theme storage and is rejected before writing. The offending input is an oversized draft config (usually from an imported package).","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_library.rs:283 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the theme config size (trim CSS/custom data) before saving","Do not import packages with bloated theme.json payloads","Split content into multiple themes if legitimately large"],"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-14T00:17:10.932Z"}