{"record":{"id":"f1ae103d414c7739","repo":"Hmbown/CodeWhale","slug":"not-persisted-err","errorCode":null,"errorMessage":" (not persisted: {err})","messagePattern":" \\(not persisted: (.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/tui/src/tui/ui/apply.rs","lineNumber":1086,"sourceCode":"    let preference_changed = app.reasoning_effort_preference != Some(effort);\n    let selection_changed = effort != previous_effort || live_changed;\n\n    if live_changed || preference_changed {\n        app.reasoning_effort = effective_effort;\n        app.reasoning_effort_preference = Some(effort);\n    }\n    if selection_changed {\n        app.invalidate_route_receipts_for_reasoning_change();\n        app.update_model_compaction_budget();\n    }\n\n    let persist_warning = app\n        .startup_defaults\n        .apply_blocking(\n            crate::tui::startup_defaults::StartupDefaults::reasoning_effort(effort.as_setting()),\n        )\n        .err()\n        .map(|err| format!(\" (not persisted: {err})\"));\n\n    if live_changed {\n        apply_model_and_compaction_update(\n            engine_handle,\n            app.compaction_config(),\n            app.mode,\n            app.active_route_limits,\n        )\n        .await;\n    }\n\n    let persisted = persist_warning.is_none();\n    let mut summary = if selection_changed {\n        format!(\n            \"Thinking: {} → {} · model {}\",\n            previous_effort.display_label_for_provider(app.api_provider),\n            effort.display_label_for_provider(app.api_provider),\n            app.model_display_label()","sourceCodeStart":1068,"sourceCodeEnd":1104,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/tui/ui/apply.rs#L1068-L1104","documentation":"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.","triggerScenarios":"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.","commonSituations":"Read-only or full disk; settings.toml locked by another TUI instance; malformed settings that the defaults writer cannot update.","solutions":["Note the effort change IS active for this session; only persistence failed — restart-safe behavior needs the fix below.","Check write permissions and free space for the settings file location.","Close other TUI instances holding the settings lock, then re-apply the effort choice.","Validate/repair settings.toml (malformed content can block writes) and pick the effort again."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check settings file is writable before offering persistence-sensitive pickers\nlet path = crate::settings::Settings::path()?;\nlet probe = std::fs::OpenOptions::new().append(true).open(&path);\nprobe.expect(\"settings file not writable; persistence will fail\");","typeGuard":null,"tryCatchPattern":"if let Err(err) = app.startup_defaults.apply_blocking(update) {\n    ui.warn(format!(\"Effort applied for this session only (not persisted: {err})\"));\n}","preventionTips":["Keep the settings file writable (check disk space and permissions).","Close duplicate TUI instances that may hold the settings lock.","Repair malformed settings.toml promptly — it can block writes.","Re-apply the effort choice after fixing persistence so it survives restarts."],"tags":["settings","persistence","model-picker","reasoning-effort"],"backgroundTag":"file-write-failed","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}