Hmbown/CodeWhale · warning

(not persisted: )

Error message

 (not persisted: {err})

What it means

A warning suffix built in apply_picker_effort_choice: after changing the reasoning effort from the model picker, the TUI tries to persist the choice via startup_defaults.apply_blocking; if persistence fails, the string ' (not persisted: {err})' is produced to append to a user-facing notice. The live session change still applies — only the across-restart persistence failed.

Solutions

  1. Note the effort change IS active for this session; only persistence failed — restart-safe behavior needs the fix below.
  2. Check write permissions and free space for the settings file location.
  3. Close other TUI instances holding the settings lock, then re-apply the effort choice.
  4. Validate/repair settings.toml (malformed content can block writes) and pick the effort again.
Defensive patterns

Strategy: try-catch

Validate before calling

// Check settings file is writable before offering persistence-sensitive pickers
let path = crate::settings::Settings::path()?;
let probe = std::fs::OpenOptions::new().append(true).open(&path);
probe.expect("settings file not writable; persistence will fail");

Try / catch

if let Err(err) = app.startup_defaults.apply_blocking(update) {
    ui.warn(format!("Effort applied for this session only (not persisted: {err})"));
}

Prevention

When it happens

Trigger: Choosing a reasoning effort in the model picker when startup defaults persistence fails — unwritable settings file, settings lock held, or disk/IO error in apply_blocking.

Common situations: Read-only or full disk; settings.toml locked by another TUI instance; malformed settings that the defaults writer cannot update.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15). Data as JSON: /api/errors/f1ae103d414c7739. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/tui/ui/apply.rs:1086

    let preference_changed = app.reasoning_effort_preference != Some(effort);
    let selection_changed = effort != previous_effort || live_changed;

    if live_changed || preference_changed {
        app.reasoning_effort = effective_effort;
        app.reasoning_effort_preference = Some(effort);
    }
    if selection_changed {
        app.invalidate_route_receipts_for_reasoning_change();
        app.update_model_compaction_budget();
    }

    let persist_warning = app
        .startup_defaults
        .apply_blocking(
            crate::tui::startup_defaults::StartupDefaults::reasoning_effort(effort.as_setting()),
        )
        .err()
        .map(|err| format!(" (not persisted: {err})"));

    if live_changed {
        apply_model_and_compaction_update(
            engine_handle,
            app.compaction_config(),
            app.mode,
            app.active_route_limits,
        )
        .await;
    }

    let persisted = persist_warning.is_none();
    let mut summary = if selection_changed {
        format!(
            "Thinking: {} → {} · model {}",
            previous_effort.display_label_for_provider(app.api_provider),
            effort.display_label_for_provider(app.api_provider),
            app.model_display_label()

View on GitHub (pinned to 433685b202)