agent_settings: Fix schema validation rejecting custom llm providers (#38248)

Closes https://github.com/zed-industries/zed/issues/37989

Release Notes:

- N/A
This commit is contained in:
Lukas Wirth
2025-09-16 10:23:49 +00:00
committed by GitHub
parent c0710fa8ca
commit c6472fd7a8
+23 -14
View File
@@ -364,21 +364,30 @@ impl JsonSchema for LanguageModelProviderSetting {
} }
fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema { fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
// list the builtin providers as a subset so that we still auto complete them in the settings
json_schema!({ json_schema!({
"enum": [ "anyOf": [
"amazon-bedrock", {
"anthropic", "type": "string",
"copilot_chat", "enum": [
"deepseek", "amazon-bedrock",
"google", "anthropic",
"lmstudio", "copilot_chat",
"mistral", "deepseek",
"ollama", "google",
"openai", "lmstudio",
"openrouter", "mistral",
"vercel", "ollama",
"x_ai", "openai",
"zed.dev" "openrouter",
"vercel",
"x_ai",
"zed.dev"
]
},
{
"type": "string",
}
] ]
}) })
} }