Hmbown/CodeWhale · error
Unknown feature flag
Error message
Unknown feature flag: {key} What it means
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.
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.
Example fix
// before (config.toml) [features] web_browsng = true // after [features] web_browsing = true
Defensive patterns
Strategy: validation
Validate before calling
use codewhale::tui::features::is_known_feature_key;
if let Some(features) = &config.features {
let unknown: Vec<_> = features.entries.keys().filter(|k| !is_known_feature_key(k)).collect();
assert!(unknown.is_empty(), "unknown feature keys: {unknown:?}");
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- agent profile provider cannot be empty
- agent profile provider must be a simple provider id
- api_key cannot be empty string
- approval_policy ' ' is not allowed by requirements ( )
- budget document_kind must be
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/50e141787502f6d0.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/config.rs:5115
match validate_kimi_code_api_model_id(
active_provider,
&self.active_route_base_url(),
&self.default_model(),
) {
Err(error) if error == KIMI_CODE_CLAUDE_ALIAS_GUIDANCE => {
return Err(SafeConfigDiagnostic::KimiCodeClaudeAlias.into());
}
result => result.map_err(anyhow::Error::msg)?,
}
if let Some(ref key) = self.api_key
&& key.trim().is_empty()
{
anyhow::bail!("api_key cannot be empty string");
}
if let Some(features) = &self.features {
for key in features.entries.keys() {
if !is_known_feature_key(key) {
anyhow::bail!("Unknown feature flag: {key}");
}
}
}
// Validate the model against the *active provider's* name space, not
// against DeepSeek's. `canonical_model_id_for_provider` is the
// equal-treatment resolver: it applies each family's own canonical map
// (GLM via Z.ai, Kimi, MiniMax, …) and passes unknown ids through, so
// it rejects only what the provider genuinely cannot serve. Validating
// with the DeepSeek-only `normalize_model_name` bricked every config
// whose provider owns a non-DeepSeek family — including ones our own
// setup wizard writes (`provider = "zai"`, `GLM-5.2`). (#4829)
// Provider-scoped choices own the active route. A retained root
// fallback can belong to a different provider after a saved switch.
let configured_model = self
.provider_config_string_with_runtime_fallback(active_provider, |entry| {
entry.model.clone()
})
.or_else(|| self.default_text_model.clone());View on GitHub (pinned to 73e0f67d83)