{"record":{"id":"3001753ffd43e39a","repo":"Hmbown/CodeWhale","slug":"vendor-is-only-supported-by-providers-openrouter-config","errorCode":null,"errorMessage":"vendor is only supported by providers.openrouter","messagePattern":"vendor is only supported by providers\\.openrouter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":5907,"sourceCode":"                &providers.modelstudio_coding_plan_anthropic\n            }\n            // Handled by the name-keyed early return above (#1519).\n            ApiProvider::Custom => unreachable!(\"custom provider resolved by name above\"),\n        })\n    }\n\n    /// Resolve the pin from the selected provider only, before any request.\n    pub(crate) fn openrouter_vendor(&self) -> Result<Option<String>> {\n        let provider = self.api_provider();\n        let Some(vendor) = self\n            .provider_config_for(provider)\n            .and_then(|entry| entry.vendor.as_deref())\n        else {\n            return Ok(None);\n        };\n        let vendor = codewhale_config::validate_openrouter_vendor(vendor)?;\n        if vendor.is_some() && provider != ApiProvider::Openrouter {\n            anyhow::bail!(\"vendor is only supported by providers.openrouter\");\n        }\n        Ok(vendor.map(str::to_string))\n    }\n\n    pub(crate) fn subagent_provider_config(\n        &self,\n        provider: ApiProvider,\n    ) -> Option<&SubagentProviderConfig> {\n        let providers = self.subagents.as_ref()?.providers.as_ref()?;\n        providers.iter().find_map(|(key, config)| {\n            subagent_provider_key_matches(key, provider).then_some(config)\n        })\n    }\n\n    pub(crate) fn provider_config_for_mut(&mut self, provider: ApiProvider) -> &mut ProviderConfig {\n        // The custom provider's mutable slot is keyed by the selected\n        // `provider = \"<name>\"` value in the flatten map (#1519). Capture the\n        // name before borrowing `providers` mutably; fall back to a private","sourceCodeStart":5889,"sourceCodeEnd":5925,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config.rs#L5889-L5925","documentation":"The `vendor` credential/endpoint qualifier is defined only for OpenRouter. The resolver reads `vendor` from the provider entry, validates it via `codewhale_config::validate_openrouter_vendor`, and if a vendor value is present for any provider other than `ApiProvider::Openrouter`, config loading fails. Other providers have no vendor concept, so a non-empty vendor there is always a misconfiguration.","triggerScenarios":"A provider entry in the `providers` config table (not `providers.openrouter`) has a non-empty `vendor` string, and the vendor resolution path (`Config::...vendor` helper at config.rs:5907) processes it.","commonSituations":"Copying an OpenRouter entry's `vendor` field into another provider block; misunderstanding `vendor` as a generic provider brand field; a migration or merge of provider configs that carried the key over.","solutions":["Remove the `vendor` key from the non-OpenRouter provider entry in your config.","If you meant to use a vendor-qualified OpenRouter route, move the `vendor` setting under `providers.openrouter`.","If you are on OpenRouter and still see this, check that `api_provider` / the active route actually selects `openrouter` — the check compares against `ApiProvider::Openrouter`."],"exampleFix":"// before (config.toml)\n[providers.anthropic]\nvendor = \"bedrock\"\n\n// after\n[providers.anthropic]\n# vendor removed; it is only valid under providers.openrouter","handlingStrategy":"validation","validationCode":"if let Some(vendor) = provider_entry.vendor.as_deref() {\n    assert!(!vendor.is_empty() || provider == \"openrouter\", \"vendor is only valid under providers.openrouter\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only write a `vendor` key inside `[providers.openrouter]`.","When copying provider blocks between entries, strip provider-specific keys like `vendor`.","Document provider-specific fields in your config templates to avoid copy-over."],"tags":["config","provider","openrouter"],"backgroundTag":"unsupported-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"}