{"record":{"id":"e1379a0588d5e19a","repo":"Hmbown/CodeWhale","slug":"set-is-per-run-and-never-saved-it-cannot-be-combined-with","errorCode":null,"errorMessage":"--set is per-run and never saved; it cannot be combined with `config set`, `config unset`, or `config import`. Drop --set, or use a read command.","messagePattern":"--set is per-run and never saved; it cannot be combined with `config set`, `config unset`, or `config import`\\. Drop --set, or use a read command\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":4492,"sourceCode":"        bail!(\n            \"--project requires a workspace config ({} is the user-global document)\",\n            store.path().display()\n        );\n    }\n    // A per-run overlay must never leak into the file: commands that write\n    // the store refuse it outright instead of saving a merged document.\n    if !per_run_overrides.is_empty()\n        && matches!(\n            command,\n            ConfigCommand::Set { .. }\n                | ConfigCommand::Unset { .. }\n                | ConfigCommand::Import(_)\n                | ConfigCommand::Telemetry {\n                    accept_notice: Some(_)\n                }\n        )\n    {\n        bail!(\n            \"--set is per-run and never saved; it cannot be combined with `config set`, \\\n             `config unset`, or `config import`. Drop --set, or use a read command.\"\n        );\n    }\n    match command {\n        ConfigCommand::Get { key } => {\n            if per_run_overrides.is_empty() && codewhale_tui::route_preferences::is_route_key(&key)\n            {\n                if let Some(value) = codewhale_tui::route_preferences::get(store.path(), &key)? {\n                    println!(\"{value}\");\n                    return Ok(());\n                }\n                bail!(\"key not found: {key}\");\n            }\n            if codewhale_config::notifications::in_namespace(&key) {\n                let config = codewhale_config::notifications::from_extras(&store.config.extras)?;\n                let keys = if key.eq_ignore_ascii_case(\"notifications\") {\n                    codewhale_config::notifications::NotificationSetting::ALL.to_vec()","sourceCodeStart":4474,"sourceCodeEnd":4510,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L4474-L4510","documentation":"`--set` values are per-run overlays that are never persisted; to protect that contract, config commands that write the store (set, unset, import, telemetry notice acceptance) refuse to run when --set is present. The error explains that --set must be dropped or a read command used.","triggerScenarios":"Invoking e.g. `codewhale config --set model=x config set other=y` — any write-shaped ConfigCommand (Set, Unset, Import, Telemetry with accept_notice) combined with per-run --set overrides.","commonSituations":"Scripts that always append --set flags for run-configuration and reuse them for `config set`; users expecting --set to persist; combining a one-off override with a permanent change in one command.","solutions":["Split the invocation: run the per-run command with --set, and `config set` without --set","Drop --set if the intent was to persist values via `config set`","Use a read command (e.g. `config get`) if only inspection was intended alongside --set"],"exampleFix":"// before\ncodewhale config --set temperature=0.2 config set model gpt-5\n// after\ncodewhale config set model gpt-5\ncodewhale --set temperature=0.2 exec \"...\"","handlingStrategy":"validation","validationCode":"if has_set_overrides && [[ \"$subcmd\" == set || \"$subcmd\" == unset || \"$subcmd\" == import ]]; then echo \"split: run --set separately from config writes\"; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep per-run --set overrides only on run/exec commands","Never build a shared flag array reused by both `config` writes and run commands"],"tags":["cli","config","flags","conflicting"],"backgroundTag":"mutually-exclusive-flags","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"}