{"record":{"id":"50e141787502f6d0","repo":"Hmbown/CodeWhale","slug":"unknown-feature-flag-key","errorCode":null,"errorMessage":"Unknown feature flag: {key}","messagePattern":"Unknown feature flag: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":5115,"sourceCode":"        match validate_kimi_code_api_model_id(\n            active_provider,\n            &self.active_route_base_url(),\n            &self.default_model(),\n        ) {\n            Err(error) if error == KIMI_CODE_CLAUDE_ALIAS_GUIDANCE => {\n                return Err(SafeConfigDiagnostic::KimiCodeClaudeAlias.into());\n            }\n            result => result.map_err(anyhow::Error::msg)?,\n        }\n        if let Some(ref key) = self.api_key\n            && key.trim().is_empty()\n        {\n            anyhow::bail!(\"api_key cannot be empty string\");\n        }\n        if let Some(features) = &self.features {\n            for key in features.entries.keys() {\n                if !is_known_feature_key(key) {\n                    anyhow::bail!(\"Unknown feature flag: {key}\");\n                }\n            }\n        }\n        // Validate the model against the *active provider's* name space, not\n        // against DeepSeek's. `canonical_model_id_for_provider` is the\n        // equal-treatment resolver: it applies each family's own canonical map\n        // (GLM via Z.ai, Kimi, MiniMax, …) and passes unknown ids through, so\n        // it rejects only what the provider genuinely cannot serve. Validating\n        // with the DeepSeek-only `normalize_model_name` bricked every config\n        // whose provider owns a non-DeepSeek family — including ones our own\n        // setup wizard writes (`provider = \"zai\"`, `GLM-5.2`). (#4829)\n        // Provider-scoped choices own the active route. A retained root\n        // fallback can belong to a different provider after a saved switch.\n        let configured_model = self\n            .provider_config_string_with_runtime_fallback(active_provider, |entry| {\n                entry.model.clone()\n            })\n            .or_else(|| self.default_text_model.clone());","sourceCodeStart":5097,"sourceCodeEnd":5133,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config.rs#L5097-L5133","documentation":"The TUI Config validator rejects any key under the `[features]` TOML table that is not in the crate's canonical FEATURES registry (`crates/tui/src/features.rs:107`). Feature flags are a closed set; typos or flags copied from other versions of the tool are refused at config-load time so they fail loud instead of being silently ignored.","triggerScenarios":"Any call to the config validation path (`Config::validate`) where `self.features.entries` contains a key for which `is_known_feature_key(key)` returns false — e.g. a misspelled or removed feature key in the `[features]` table of the Codewhale config file.","commonSituations":"Hand-editing the config file and misspelling a feature key; copying a `[features]` block from an older/newer release where the flag was renamed or removed; guessing flag names without checking the FEATURES table.","solutions":["Open the error message, take the offending `{key}`, and check the FEATURES registry in crates/tui/src/features.rs for the exact accepted key name.","Remove the unknown key from the `[features]` table in your config file if you do not need it.","If the flag existed in a previous version, consult the release notes for its rename and use the new key.","Regenerate a known-good config rather than guessing key names."],"exampleFix":"// before (config.toml)\n[features]\nweb_browsng = true\n\n// after\n[features]\nweb_browsing = true","handlingStrategy":"validation","validationCode":"use codewhale::tui::features::is_known_feature_key;\nif let Some(features) = &config.features {\n    let unknown: Vec<_> = features.entries.keys().filter(|k| !is_known_feature_key(k)).collect();\n    assert!(unknown.is_empty(), \"unknown feature keys: {unknown:?}\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy feature keys only from the FEATURES registry or generated docs, never by memory.","Diff your `[features]` table against the shipped default config after every upgrade.","Treat feature keys as versioned: re-check them when bumping Codewhale."],"tags":["config","validation","feature-flags"],"backgroundTag":"invalid-config-value","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"}