{"record":{"id":"217fb90fd337ce42","repo":"Hmbown/CodeWhale","slug":"unknown-field-field-key-for-built-in-provider","errorCode":null,"errorMessage":"unknown field '{field_key}' for built-in provider '{provider_id}': expected one of api_key, base_url, model, context_window, mode, auth_mode, insecure_skip_tls_verify, http_headers, path_suffix","messagePattern":"unknown field '(.+?)' for built-in provider '(.+?)': expected one of api_key, base_url, model, context_window, mode, auth_mode, insecure_skip_tls_verify, http_headers, path_suffix","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/config/src/lib.rs","lineNumber":2671,"sourceCode":"            .entry(provider_id.to_string())\n            .or_insert_with(|| toml::Value::Table(toml::value::Table::new()));\n        entry.as_table_mut().with_context(|| {\n            format!(\"custom provider '{provider_id}' must be a [providers.{provider_id}] table\")\n        })\n    }\n\n    /// Write one leg of a custom provider table. Named custom providers are\n    /// not in [`ProviderKind::ALL`], so without this path\n    /// `config set providers.<custom>.<field>` fell through to a literal\n    /// top-level extras key and silently never took effect (#5167).\n    fn set_custom_provider_value(\n        &mut self,\n        provider_id: &str,\n        field_key: &str,\n        value: &str,\n    ) -> Result<()> {\n        if is_builtin_provider_config_id(provider_id) {\n            bail!(\n                \"unknown field '{field_key}' for built-in provider '{provider_id}': \\\n                 expected one of api_key, base_url, model, context_window, mode, auth_mode, \\\n                 insecure_skip_tls_verify, http_headers, path_suffix\"\n            );\n        }\n        if field_key == \"kind\" {\n            let compatible =\n                value.trim().to_ascii_lowercase().replace('_', \"-\") == \"openai-compatible\";\n            if !compatible {\n                bail!(\n                    \"custom provider '{provider_id}' must set [providers.{provider_id}].kind = \\\"openai-compatible\\\"\"\n                );\n            }\n            self.custom_provider_table_mut(provider_id)?.insert(\n                \"kind\".to_string(),\n                toml::Value::String(value.trim().to_string()),\n            );\n            return Ok(());","sourceCodeStart":2653,"sourceCodeEnd":2689,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/config/src/lib.rs#L2653-L2689","documentation":"set_custom_provider_value (crates/config/src/lib.rs:2671) rejects `config set providers.<id>.<field>` when <id> is a built-in provider config id. Built-in providers accept a fixed field set (api_key, base_url, model, context_window, mode, auth_mode, insecure_skip_tls_verify, http_headers, path_suffix); without this guard the write fell through to a literal extras key and silently never took effect (#5167). Note `wire` and `kind` are custom-provider-only fields.","triggerScenarios":"Running `codewhale config set providers.openai.<field> <value>` (or any built-in id) where <field> is not in the accepted list — typically a typo like contex_window, or a custom-only field like kind/wire applied to a built-in id.","commonSituations":"Typos in long CLI field names, assuming the custom-provider field list applies to built-ins, scripting config edits without checking the field name first.","solutions":["Fix the field name to one from the listed set (e.g. context_window, base_url, api_key)","If you need kind or wire, create a named custom provider id instead of using a built-in one","Check current keys with `config get`-style surfaces before writing"],"exampleFix":"# before\ncodewhale config set providers.openai.contex_window 128000\n# -> unknown field 'contex_window' for built-in provider 'openai'\n\n# after\ncodewhale config set providers.openai.context_window 128000","handlingStrategy":"validation","validationCode":"const BUILTIN_FIELDS: &[&str] = &[\"api_key\",\"base_url\",\"model\",\"context_window\",\"mode\",\"auth_mode\",\"insecure_skip_tls_verify\",\"http_headers\",\"path_suffix\"];\nassert!(BUILTIN_FIELDS.contains(&field_key)); // before config set on a built-in id","typeGuard":"fn is_builtin_provider_field(id: &str, field: &str) -> bool {\n    is_builtin_provider_config_id(id) && [\"api_key\",\"base_url\",\"model\",\"context_window\",\"mode\",\"auth_mode\",\"insecure_skip_tls_verify\",\"http_headers\",\"path_suffix\"].contains(&field)\n}","tryCatchPattern":null,"preventionTips":["Use the field list from the error message as the allowlist in scripts","Dry-run scripted config sets against a scratch config","Prefer config get to inspect the current schema before writing new keys"],"tags":["rust","config","cli","validation","typo"],"backgroundTag":"unknown-config-field","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}