{"record":{"id":"6aef89b5caac9f0b","repo":"Hmbown/CodeWhale","slug":"runtime-presets-cannot-override-source-change-t","errorCode":null,"errorMessage":"Runtime presets cannot override {source}; change that controlling source first","messagePattern":"Runtime presets cannot override (.+?); change that controlling source first","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/ui/apply.rs","lineNumber":2849,"sourceCode":"            engine_handle.cancel();\n            mark_active_turn_cancelled_locally(app);\n            app.status_message = Some(parent_stop_status(app, \"Request cancelled\"));\n        }\n    }\n}\n\npub(crate) fn apply_setup_runtime_preset(\n    app: &mut App,\n    config: &mut Config,\n    preset: crate::tui::setup::SetupRuntimePreset,\n    state: codewhale_config::SetupState,\n) -> Result<String> {\n    if let Some(source) = config.runtime_preset_blocker(\n        app.config_path.as_deref(),\n        app.config_profile.as_deref(),\n        &app.workspace,\n    ) {\n        anyhow::bail!(\n            \"Runtime presets cannot override {source}; change that controlling source first\"\n        );\n    }\n    if preset == crate::tui::setup::SetupRuntimePreset::HighTrustLocal {\n        let approval = config.approval_policy_control(\n            app.config_path.as_deref(),\n            app.config_profile.as_deref(),\n            &app.workspace,\n        );\n        if !approval.editable_root() {\n            anyhow::bail!(\n                \"Full Access cannot override {}; change that controlling source first\",\n                approval.label()\n            );\n        }\n    }\n\n    let settings_path = Settings::path().context(\"failed to resolve settings path\")?;","sourceCodeStart":2831,"sourceCodeEnd":2867,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tui/ui/apply.rs#L2831-L2867","documentation":"Applying a runtime preset (via the apply path in the TUI) is blocked because a higher-priority controlling source — such as a managed policy file or CLI flag — already governs the same setting. The error names that source so the user changes the real controller first; runtime presets are strictly lower precedence.","triggerScenarios":"Calling the apply-preset function when `config.runtime_preset_blocker(...)` returns a source (e.g. managed config file, CLI override, enterprise policy) for the given config path/profile/workspace.","commonSituations":"Enterprise-managed configuration deployed via policy file; user launched with a CLI flag that pins the setting; profile-specific config overriding runtime presets.","solutions":["Read the `{source}` named in the message and edit/remove that controlling configuration first","Remove the CLI flag or managed-policy entry that pins the setting, then re-apply the preset","Apply the equivalent setting directly in the controlling source instead of via a runtime preset"],"exampleFix":"// before: setting preset while managed-config pins it\napply_preset(SetupRuntimePreset::HighTrustLocal)\n// after: remove managed override first, then\napply_preset(SetupRuntimePreset::HighTrustLocal)","handlingStrategy":"validation","validationCode":"if let Some(source) = config.runtime_preset_blocker(\n    config_path.as_deref(), profile.as_deref(), &workspace)\n{\n    eprintln!(\"preset blocked by {source}; change it first\");\n    return;\n}\napply_preset(preset)?;","typeGuard":null,"tryCatchPattern":"match apply_preset(preset) {\n    Err(e) if e.to_string().starts_with(\"Runtime presets cannot override\") => {\n        // surface the controlling source to the user instead of retrying\n        show_controlling_source_hint(&e);\n    }\n    r => r,\n}","preventionTips":["Check which source controls approval/model settings before applying presets","Avoid CLI flags or managed policies that pin settings if you plan to use runtime presets","Keep managed/policy config under admin control and presets for interactive use only"],"tags":["rust","config","precedence","tui"],"backgroundTag":"conflicting-config-options","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"}