{"record":{"id":"42205a88196e5de9","repo":"Hmbown/CodeWhale","slug":"configured-theme-could-not-be-loaded-usin","errorCode":null,"errorMessage":"⚠ configured theme '{}' could not be loaded — using System ({error})","messagePattern":"⚠ configured theme '(.+?)' could not be loaded — using System \\((.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/tui/src/tui/app/init.rs","lineNumber":336,"sourceCode":"        let transcript_spacing = TranscriptSpacing::from_setting(&settings.transcript_spacing);\n        let max_input_history = settings.max_input_history;\n        // Requesting bracketed paste does not prove the terminal delivers it.\n        // Keep the fallback until handle_paste_burst_key observes a real paste\n        // via bracketed_paste_seen; otherwise raw pasted newlines can submit.\n        let use_paste_burst_detection = settings.paste_burst_detection;\n        // Resolve the named theme from settings; unknown values were already\n        // normalised to the underwater default in Settings::load. The\n        // background_color setting still overlays on top.\n        let background_color_override = settings\n            .background_color\n            .as_deref()\n            .and_then(palette::parse_hex_rgb_color);\n        let background_setting = background_color_override.and_then(palette::hex_rgb_string);\n        let resolved_theme =\n            palette::resolve_theme_setting(&settings.theme, background_setting.as_deref());\n        let theme_warning = resolved_theme.as_ref().err().map(|error| {\n            format!(\n                \"⚠ configured theme '{}' could not be loaded — using System ({error})\",\n                settings.theme\n            )\n        });\n        let (theme_name, theme_id, ui_theme) = resolved_theme.unwrap_or_else(|_| {\n            let id = palette::ThemeId::System;\n            let mut theme = id.ui_theme();\n            if let Some(background) = background_color_override {\n                theme = theme.with_background_color(background);\n            }\n            (id.name().to_string(), id, theme)\n        });\n        // Remembered route choices were resolved once into Config. The\n        // chooser and hotbar must not revive archived Settings values.\n        let mut provider_models = HashMap::new();\n        for &candidate in ApiProvider::all() {\n            if candidate != ApiProvider::Custom\n                && let Some(model) = config\n                    .provider_config_for(candidate)","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tui/app/init.rs#L318-L354","documentation":"During TUI init, the theme name from settings is resolved via palette::resolve_theme_setting. If resolution fails (unknown theme name, unparseable custom color), the app logs this warning and falls back to the System theme instead of crashing.","triggerScenarios":"settings.theme names a theme not in the registry, or resolve_theme_setting fails parsing the custom background hex color (paired background_setting), producing an Err.","commonSituations":"Typo in theme name in settings.toml; theme renamed across versions; invalid hex color string for a background override; config copied from another machine with a theme that isn't installed.","solutions":["Check the theme value in settings.toml against the available theme names in palette::ThemeId (e.g. System, Dark, Light) and correct the typo","Remove or fix the custom background hex color value if the error mentions the color","Reset to the default by deleting/commenting the `theme` key, letting the app use System, then choose a valid theme from within the TUI"],"exampleFix":"# before\ntheme = \"gruvox-dark\"\n# after\ntheme = \"Dark\"","handlingStrategy":"validation","validationCode":"// before putting a theme in settings.toml\nlet valid = [\"System\", \"Dark\", \"Light\"]; // per palette::ThemeId\nlet theme = std::env::var(\"THEME\").unwrap_or_default();\nif !valid.contains(&theme.as_str()) {\n    eprintln!(\"unknown theme '{theme}'; valid: {valid:?}\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick theme names from inside the TUI theme picker rather than typing them","Verify any custom background hex color matches #[0-9a-fA-F]{6} before saving","Re-check the theme key after upgrading, since theme names can change across versions"],"tags":["theme","config","fallback"],"backgroundTag":"invalid-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}