{"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":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/ui/apply.rs","lineNumber":2261,"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":2243,"sourceCodeEnd":2279,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tui/ui/apply.rs#L2243-L2279","documentation":"Raised in apply_setup_runtime_preset when config.runtime_preset_blocker reports a controlling config source (CLI flag, env var, or explicit file setting) that would be overridden by applying the runtime preset. The message names that source via {source}; presets refuse to silently clobber an explicitly set controlling value.","triggerScenarios":"Thrown at crates/tui/src/tui/ui/apply.rs:2261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change or remove the controlling source named in the error (env var, CLI flag, or config file entry)","Apply the preset only after the explicit setting is cleared","Set the desired value directly in the controlling source instead of using the preset"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}