{"record":{"id":"dea3bbf1b83a6854","repo":"Hmbown/CodeWhale","slug":"key-not-found-key","errorCode":null,"errorMessage":"key not found: {key}","messagePattern":"key not found: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/lib.rs","lineNumber":4505,"sourceCode":"                | 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()\n                } else {\n                    vec![codewhale_config::notifications::NotificationSetting::required(&key)?]\n                };\n                for setting in keys {\n                    if key.eq_ignore_ascii_case(\"notifications\") {\n                        println!(\n                            \"notifications.{} = {}\",\n                            setting.key(),\n                            config.display(setting)\n                        );\n                    } else {\n                        println!(\"{}\", config.display(setting));\n                    }","sourceCodeStart":4487,"sourceCodeEnd":4523,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/lib.rs#L4487-L4523","documentation":"The `codewhale config get <key>` command resolves a key either through route preferences or notification settings; if the key is a valid route key but has no stored value (get returns None), the command aborts with this error. It signals the user asked to read a config key that has never been set.","triggerScenarios":"Running `codewhale config get <route-key>` when `route_preferences::get` returns Ok(None) — i.e. the key is recognized as a route key but no preference was ever persisted.","commonSituations":"Fresh installation with no saved route preferences; typo-free but never-set key such as `model` before any `config set model` call; reading a key after preferences file was deleted or reset.","solutions":["Run `codewhale config set <key> <value>` to create the value, then get it again.","List available keys (e.g. `codewhale config doctor` or dump) to confirm the key name and whether it is expected to have a value.","Check that the store preferences file at store.path() exists and was not wiped."],"exampleFix":"// before\ncodewhale config get model\n// after\ncodewhale config set model <model-name> && codewhale config get model","handlingStrategy":"validation","validationCode":"if codewhale_tui::route_preferences::is_route_key(&key) && codewhale_tui::route_preferences::get(store.path(), &key)?.is_none() {\n    eprintln!(\"key '{key}' is not set yet; run 'codewhale config set {key} <value>' first\");\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().starts_with(\"key not found\") => {\n        eprintln!(\"not set yet — set it first with 'codewhale config set'\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => println!(\"{v}\"),\n}","preventionTips":["Set route preferences during initial setup so get always finds them.","Check is_route_key before calling get to distinguish known keys from typos.","Keep the preferences file backed up; deleting it re-triggers this on previously valid keys."],"tags":["cli","config"],"backgroundTag":"missing-config-key","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"}