core/config+cli: empty models are bad; prompt model on provider switch

Reject providers with no models into bad_providers and warn with reasons
on chat/providers. When /provider changes and the current model is not
listed, prompt for a new model (keep it when still supported).
This commit is contained in:
2026-07-15 14:17:34 +08:00
parent 64d288a9b1
commit 553d491cbc
7 changed files with 155 additions and 10 deletions
+6
View File
@@ -6,6 +6,9 @@ url = ":memory:"
preset = "openai"
access_key_or_token = "sk-1145141919810"
[providers.test1.models]
"gpt-test" = { text = true }
[providers.test2]
preset = "openai-compatible"
url = "https://www.example.com/v1"
@@ -18,6 +21,9 @@ access_key_or_token = "sk-1145141919810"
preset = "anthropic"
access_key_or_token = "sk-1145141919810"
[providers.test3.models]
"claude-test" = { text = true }
[providers.foo1]
preset = "deepseek"
access_key_or_token = "sk-1145141919810"