Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

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

Lukas Wirthc6472fd7a8cf
diff --git a/crates/agent_settings/src/agent_settings.rs b/crates/agent_settings/src/agent_settings.rs
index 153b64a3950..71516b568c2 100644
--- a/crates/agent_settings/src/agent_settings.rs
+++ b/crates/agent_settings/src/agent_settings.rs
@@ -364,21 +364,30 @@ impl JsonSchema for LanguageModelProviderSetting {
}
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!({
- "enum": [
- "amazon-bedrock",
- "anthropic",
- "copilot_chat",
- "deepseek",
- "google",
- "lmstudio",
- "mistral",
- "ollama",
- "openai",
- "openrouter",
- "vercel",
- "x_ai",
- "zed.dev"
+ "anyOf": [
+ {
+ "type": "string",
+ "enum": [
+ "amazon-bedrock",
+ "anthropic",
+ "copilot_chat",
+ "deepseek",
+ "google",
+ "lmstudio",
+ "mistral",
+ "ollama",
+ "openai",
+ "openrouter",
+ "vercel",
+ "x_ai",
+ "zed.dev"
+ ]
+ },
+ {
+ "type": "string",
+ }
]
})
}