feat: apply provider quirks to models created from a name

Unknown chat/reranker models resolved through the create-from-name
fallback now inherit their provider's family rules (require_max_tokens,
reasoning defaults, etc.) from the quirks overlay, and the model
completion table marks reasoning-capable models with a brain glyph.
This commit is contained in:
Dark-Alex-17 committed 2026-09-03 11:17:58 -06:00
1 parent f1cb6589bc
commit 012212a998
2 files changed
+61 -3

No files matched your search

+11 -2
View File
@@ -5232,7 +5232,7 @@ mod tests {
// with an empty client list, which would permanently pin every later
// model lookup in this process to "unknown model" and make any test that
// needs a resolvable model dependent on test ordering. Seed the caches
// before any test runs with one client, "test-seeded", exposing a single
// before any test runs with a client, "test-seeded", exposing a single
// embedding model. Deliberately NO chat model: some tests assert that no
// chat model is available, and chat lookups don't need one — a
// "test-seeded:<anything>" chat id resolves through the create-from-name
@@ -5252,8 +5252,17 @@ mod tests {
embedder.model_type = "embedding".to_string();
config.models = vec![embedder];
}
// A claude client is seeded alongside it so tests can exercise
// provider-quirk inheritance through the create-from-name fallback.
// It deliberately carries one embedding model: an empty `models` list
// would fall back to the full embedded claude catalog and register
// real chat models, breaking the no-chat-model invariant above.
let claude: ClientConfig = serde_yaml::from_str(
"type: claude\nmodels:\n - name: test-claude-embedder\n type: embedding\n",
)
.unwrap();
let config = AppConfig {
clients: vec![client],
clients: vec![client, claude],
..AppConfig::default()
};
let _ = list_client_names(&config);