Hmbown/CodeWhale · error

⚠ configured theme '{}' could not be loaded — using System (

Error message

⚠ configured theme '{}' could not be loaded — using System ({error})

What it means

At startup the configured theme name (already normalized in Settings::load) is resolved from the theme registry; if loading fails — unknown name, unreadable theme asset, or palette mismatch — the message reports the load error and the app falls back to the System theme rather than aborting launch.

Source

Thrown at crates/tui/src/tui/app/init.rs:311

        let composer_vim_enabled = settings
            .composer_vim_mode
            .trim()
            .eq_ignore_ascii_case("vim");
        let transcript_spacing = TranscriptSpacing::from_setting(&settings.transcript_spacing);
        let max_input_history = settings.max_input_history;
        let use_paste_burst_detection = settings.paste_burst_detection;
        // Resolve the named theme from settings; unknown values were already
        // normalised to "system" in Settings::load. The background_color
        // setting still overlays on top.
        let background_color_override = settings
            .background_color
            .as_deref()
            .and_then(palette::parse_hex_rgb_color);
        let background_setting = background_color_override.and_then(palette::hex_rgb_string);
        let resolved_theme =
            palette::resolve_theme_setting(&settings.theme, background_setting.as_deref());
        let theme_warning = resolved_theme.as_ref().err().map(|error| {
            format!(
                "⚠ configured theme '{}' could not be loaded — using System ({error})",
                settings.theme
            )
        });
        let (_, theme_id, ui_theme) = resolved_theme.unwrap_or_else(|_| {
            let id = palette::ThemeId::System;
            let mut theme = id.ui_theme();
            if let Some(background) = background_color_override {
                theme = theme.with_background_color(background);
            }
            (id.name().to_string(), id, theme)
        });
        let provider_models = settings.provider_models.clone().unwrap_or_default();
        // `provider_models` remembers the last `/model` pick per provider. It
        // is a convenience default, not an override: when this launch named a
        // model explicitly (`--model`, forwarded as `CODEWHALE_MODEL`), that
        // request wins. Before this fix the memory won unconditionally, so
        // `codewhale --provider moonshot --model kimi-k3` silently kept running

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Correct the theme name in settings to a registered theme
  2. Check the error detail for missing/corrupt theme assets
  3. Continue with System theme if the custom theme is optional
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/tui/src/tui/app/init.rs:311 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/42205a88196e5de9. Report an issue: GitHub.