Skip to main content

vtcode_config/models/model_id/
capabilities.rs

1use crate::models::{Provider, ProviderModelSupport};
2
3use super::ModelId;
4
5#[allow(dead_code, reason = "Intentional compatibility, platform, or test-only suppression.")]
6mod capability_generated {
7    include!(concat!(env!("OUT_DIR"), "/model_capabilities.rs"));
8}
9
10/// Catalog metadata generated from `docs/models.json`.
11#[derive(Clone, Copy, Debug, PartialEq)]
12pub struct ModelPricing {
13    pub input: Option<f64>,
14    pub output: Option<f64>,
15    pub cache_read: Option<f64>,
16    pub cache_write: Option<f64>,
17}
18
19#[derive(Clone, Copy, Debug, PartialEq)]
20pub struct ModelCatalogEntry {
21    pub(crate) provider: &'static str,
22    id: &'static str,
23    pub display_name: &'static str,
24    pub description: &'static str,
25    pub context_window: usize,
26    max_output_tokens: Option<usize>,
27    pub reasoning: bool,
28    pub reasoning_efforts: &'static [&'static str],
29    pub is_pro: bool,
30    pub lightweight_model: Option<&'static str>,
31    pub tool_call: bool,
32    pub vision: bool,
33    pub input_modalities: &'static [&'static str],
34    pub caching: bool,
35    pub structured_output: bool,
36    pub supports_sampling: bool,
37    pub supports_logprobs: bool,
38    pub prompt_cache_ttl: Option<&'static str>,
39    pub prompt_contract: Option<&'static str>,
40    pub pricing: ModelPricing,
41}
42
43fn catalog_provider_key(provider: &str) -> &str {
44    if provider.eq_ignore_ascii_case("google") || provider.eq_ignore_ascii_case("gemini") {
45        "gemini"
46    } else if provider.eq_ignore_ascii_case("openai") {
47        "openai"
48    } else if provider.eq_ignore_ascii_case("anthropic") {
49        "anthropic"
50    } else if provider.eq_ignore_ascii_case("deepseek") {
51        "deepseek"
52    } else if provider.eq_ignore_ascii_case("meta") || provider.eq_ignore_ascii_case("meta-ai") {
53        "meta"
54    } else if provider.eq_ignore_ascii_case("openrouter") {
55        "openrouter"
56    } else if provider.eq_ignore_ascii_case("ollama") {
57        "ollama"
58    } else if provider.eq_ignore_ascii_case("lmstudio") {
59        "lmstudio"
60    } else if provider.eq_ignore_ascii_case("llamacpp") || provider.eq_ignore_ascii_case("llama.cpp") {
61        "llamacpp"
62    } else if provider.eq_ignore_ascii_case("moonshot") {
63        "moonshot"
64    } else if provider.eq_ignore_ascii_case("zai") {
65        "zai"
66    } else if provider.eq_ignore_ascii_case("minimax") {
67        "minimax"
68    } else if provider.eq_ignore_ascii_case("huggingface") {
69        "huggingface"
70    } else if provider.eq_ignore_ascii_case("stepfun") {
71        "stepfun"
72    } else if provider.eq_ignore_ascii_case("evolink") {
73        "evolink"
74    } else if provider.eq_ignore_ascii_case("poolside") {
75        "poolside"
76    } else if provider.eq_ignore_ascii_case("xai") {
77        "xai"
78    } else if provider.eq_ignore_ascii_case("nvidia") {
79        "nvidia"
80    } else if provider.eq_ignore_ascii_case("merge-gateway") {
81        "merge-gateway"
82    } else if provider.eq_ignore_ascii_case("vercel") || provider.eq_ignore_ascii_case("vercel-ai-gateway") {
83        "vercel"
84    } else {
85        provider
86    }
87}
88
89fn capability_provider_key(provider: Provider) -> &'static str {
90    match provider {
91        Provider::Gemini => "gemini",
92        Provider::OpenAI => "openai",
93        Provider::Anthropic => "anthropic",
94        Provider::Copilot => "copilot",
95        Provider::DeepSeek => "deepseek",
96        Provider::Meta => "meta",
97        Provider::OpenRouter => "openrouter",
98        Provider::Ollama => "ollama",
99        Provider::OllamaCloud => "ollama-cloud",
100        Provider::LmStudio => "lmstudio",
101        Provider::LlamaCpp => "llamacpp",
102        Provider::Moonshot => "moonshot",
103        Provider::ZAI => "zai",
104        Provider::Minimax => "minimax",
105        Provider::MiMo => "mimo",
106        Provider::Mistral => "mistral",
107        Provider::HuggingFace => "huggingface",
108        Provider::OpenCodeZen => "opencode-zen",
109        Provider::OpenCodeGo => "opencode-go",
110        Provider::Qwen => "qwen",
111        Provider::StepFun => "stepfun",
112        Provider::Evolink => "evolink",
113        Provider::Poolside => "poolside",
114        Provider::XAI => "xai",
115        Provider::NVIDIA => "nvidia",
116        Provider::MergeGateway => "merge-gateway",
117        Provider::Vercel => "vercel",
118    }
119}
120
121fn catalog_lookup_id<'a>(provider: &str, id: &'a str) -> &'a str {
122    let provider_key = catalog_provider_key(provider);
123    if provider_key == "evolink"
124        && let Some((prefix, model_id)) = id.split_once('/')
125        && prefix.eq_ignore_ascii_case(provider_key)
126    {
127        // Evolink namespaces its ModelId values to avoid collisions with
128        // first-class providers, while its catalog stores the upstream model
129        // id that the gateway receives (for example, `deepseek-v4-pro`).
130        return model_id;
131    }
132    id
133}
134
135fn generated_catalog_entry(provider: &str, id: &str) -> Option<ModelCatalogEntry> {
136    let provider_key = catalog_provider_key(provider);
137    let lookup_id = catalog_lookup_id(provider_key, id);
138    // Exact match wins so gateway providers that store prefixed IDs
139    // (`merge-gateway`/`vercel` keep `openai/gpt-5.6-luna`) keep working.
140    // Fall back to stripping a provider-prefixed request model
141    // (`openai/gpt-5.6-luna` on provider `openai` stores `gpt-5.6-luna`).
142    // The strip is provider-scoped (prefix must equal the provider key) so an
143    // unrelated prefix (`other-org/gpt-5.6-luna`) does not resolve to the bare
144    // model's capabilities. Without this, reasoning-effort and context
145    // lookups miss and the harness omits the effort with an empty
146    // `supported:` diagnostic.
147    let entry = capability_generated::metadata_for(provider_key, lookup_id).or_else(|| {
148        lookup_id
149            .split_once('/')
150            .filter(|(prefix, _)| prefix.eq_ignore_ascii_case(provider_key))
151            .and_then(|(_, rest)| capability_generated::metadata_for(provider_key, rest))
152    });
153    entry.map(|entry| ModelCatalogEntry {
154        provider: entry.provider,
155        id: entry.id,
156        display_name: entry.display_name,
157        description: entry.description,
158        context_window: entry.context_window,
159        max_output_tokens: entry.max_output_tokens,
160        reasoning: entry.reasoning,
161        reasoning_efforts: entry.reasoning_efforts,
162        is_pro: entry.is_pro,
163        lightweight_model: entry.lightweight_model,
164        tool_call: entry.tool_call,
165        vision: entry.vision,
166        input_modalities: entry.input_modalities,
167        caching: entry.caching,
168        structured_output: entry.structured_output,
169        supports_sampling: entry.supports_sampling,
170        supports_logprobs: entry.supports_logprobs,
171        prompt_cache_ttl: entry.prompt_cache_ttl,
172        prompt_contract: entry.prompt_contract,
173        pricing: ModelPricing {
174            input: entry.pricing.input,
175            output: entry.pricing.output,
176            cache_read: entry.pricing.cache_read,
177            cache_write: entry.pricing.cache_write,
178        },
179    })
180}
181
182pub fn model_catalog_entry(provider: &str, id: &str) -> Option<ModelCatalogEntry> {
183    generated_catalog_entry(provider, id)
184}
185
186pub fn supported_models_for_provider(provider: &str) -> Option<&'static [&'static str]> {
187    capability_generated::models_for_provider(catalog_provider_key(provider))
188}
189
190pub fn catalog_provider_keys() -> &'static [&'static str] {
191    capability_generated::PROVIDERS
192}
193
194impl ModelId {
195    fn generated_capabilities(&self) -> Option<ModelCatalogEntry> {
196        generated_catalog_entry(capability_provider_key(self.provider()), &self.as_str())
197    }
198
199    /// Preferred built-in lightweight sibling or lower-tier fallback for this model.
200    pub fn preferred_lightweight_variant(&self) -> Option<Self> {
201        let target_id = self.generated_capabilities()?.lightweight_model?;
202        Self::all_models().into_iter().find(|candidate| {
203            candidate != self && candidate.provider() == self.provider() && candidate.as_str() == target_id
204        })
205    }
206
207    /// Attempt to find a non-reasoning variant for this model.
208    pub fn non_reasoning_variant(&self) -> Option<Self> {
209        if let Some(meta) = self.openrouter_metadata() {
210            if !meta.reasoning {
211                return None;
212            }
213
214            let vendor = meta.vendor;
215            let mut candidates: Vec<Self> = Self::openrouter_vendor_groups()
216                .into_iter()
217                .find(|(candidate_vendor, _)| *candidate_vendor == vendor)
218                .map(|(_, models)| {
219                    models
220                        .iter()
221                        .filter(|&candidate| candidate != self)
222                        .filter(|&candidate| {
223                            candidate.openrouter_metadata().map(|other| !other.reasoning).unwrap_or(false)
224                        })
225                        .cloned()
226                        .collect()
227                })
228                .unwrap_or_default();
229
230            if candidates.is_empty() {
231                return None;
232            }
233
234            candidates.sort_by_key(|candidate| {
235                candidate
236                    .openrouter_metadata()
237                    .map(|data| (!data.efficient, data.display))
238                    .unwrap_or((true, ""))
239            });
240
241            return candidates.into_iter().next();
242        }
243
244        self.preferred_lightweight_variant()
245            .filter(|candidate| !candidate.is_reasoning_variant())
246    }
247
248    /// Check if this is a "flash" variant (optimized for speed)
249    pub fn is_flash_variant(&self) -> bool {
250        matches!(
251            self,
252            ModelId::Gemini38Flash
253                | ModelId::MergeGatewayGoogleGemini38Flash
254                | ModelId::VercelGoogleGemini38Flash
255                | ModelId::VercelDeepseekFlash
256                | ModelId::VercelOpenAiGpt56Luna
257                | ModelId::VercelAnthropicClaudeHaiku45
258                | ModelId::ClaudeHaiku55
259                | ModelId::MergeGatewayAnthropicClaudeHaiku4520251001
260                | ModelId::MergeGatewayAnthropicClaudeHaiku55
261                | ModelId::StepFun37Flash
262                | ModelId::MergeGatewayDeepseekFlash
263                | ModelId::DeepSeekFlash
264                | ModelId::OllamaDeepSeekV41FlashCloud
265                | ModelId::ZaiGlm53Flash
266                | ModelId::ZaiGlm53Flashx
267                | ModelId::OllamaGlm53FlashCloud
268                | ModelId::MergeGatewayZaiGlm53Flash
269                | ModelId::MergeGatewayZaiGlm53Flashx
270                | ModelId::HuggingFaceGlm53FlashTogether
271                | ModelId::MiMoV26Flash
272                | ModelId::MergeGatewayXiaomimimoMimoV26Flash
273        )
274    }
275
276    /// Check if this is a "pro" variant (optimized for capability)
277    pub fn is_pro_variant(&self) -> bool {
278        self.generated_capabilities().is_some_and(|entry| entry.is_pro)
279    }
280
281    /// Check if this is an optimized/efficient variant
282    pub fn is_efficient_variant(&self) -> bool {
283        if let Some(meta) = self.openrouter_metadata() {
284            return meta.efficient;
285        }
286        matches!(
287            self,
288            ModelId::Gemini38Flash
289                | ModelId::MergeGatewayGoogleGemini38Flash
290                | ModelId::GPT56Luna
291                | ModelId::GPT6Luna
292                | ModelId::MergeGatewayOpenAIGpt56Luna
293                | ModelId::MergeGatewayOpenAIGpt6Luna
294                | ModelId::CopilotGPT54Mini
295                | ModelId::ClaudeHaiku55
296                | ModelId::MergeGatewayAnthropicClaudeHaiku55
297                | ModelId::DeepSeekFlash
298                | ModelId::OllamaDeepSeekV41FlashCloud
299                | ModelId::MergeGatewayDeepseekFlash
300                | ModelId::MetaMuseSpark11
301                | ModelId::MergeGatewayMinimaxH3
302                | ModelId::MiMoV26Flash
303                | ModelId::ZaiGlm53Flash
304                | ModelId::ZaiGlm53Flashx
305                | ModelId::OllamaGlm53FlashCloud
306                | ModelId::MergeGatewayZaiGlm53Flash
307                | ModelId::MergeGatewayZaiGlm53Flashx
308                | ModelId::HuggingFaceGlm53FlashTogether
309                | ModelId::VercelDeepseekFlash
310                | ModelId::MergeGatewayXiaomimimoMimoV26Flash
311        )
312    }
313
314    /// Check if this is a top-tier model
315    pub fn is_top_tier(&self) -> bool {
316        if let Some(meta) = self.openrouter_metadata() {
317            return meta.top_tier;
318        }
319        matches!(
320            self,
321            ModelId::Gemini38Flash
322                | ModelId::MergeGatewayGoogleGemini38Flash
323                | ModelId::Gemini4Argon
324                | ModelId::MergeGatewayGoogleGemini4Argon
325                | ModelId::GPT6Astra
326                | ModelId::GPT6Sol
327                | ModelId::GPT61Sol
328                | ModelId::GPT56Sol
329                | ModelId::MergeGatewayOpenAIGpt56Sol
330                | ModelId::MergeGatewayOpenAIGpt56Terra
331                | ModelId::MergeGatewayOpenAIGpt56Luna
332                | ModelId::MergeGatewayOpenAIGpt6Astra
333                | ModelId::MergeGatewayOpenAIGpt6Sol
334                | ModelId::MergeGatewayOpenAIGpt61Sol
335                | ModelId::MergeGatewayOpenAIGpt6Luna
336                | ModelId::ClaudeSonnet5
337                | ModelId::ClaudeSonnet55
338                | ModelId::ClaudeFable5
339                | ModelId::ClaudeFable51
340                | ModelId::ClaudeOpus5
341                | ModelId::ClaudeOpus55
342                | ModelId::MistralLarge4
343                | ModelId::OpenCodeGoGlm53
344                | ModelId::MiMoV26Pro
345                | ModelId::MiMoV26ProUltraspeed
346                | ModelId::OpenCodeGoMinimaxM3
347                | ModelId::MergeGatewayDeepseekFlash
348                | ModelId::VercelDeepseekFlash
349                | ModelId::MetaMuseSpark13
350                | ModelId::MetaMuseSpark13Contributor
351                | ModelId::MetaMuseWonder10
352                | ModelId::MetaMuseWonderFull10
353                | ModelId::ZaiGlm53
354                | ModelId::ZaiGlm53Flash
355                | ModelId::ZaiGlm53Flashx
356                | ModelId::MergeGatewayZaiGlm53Flash
357                | ModelId::MergeGatewayZaiGlm53Flashx
358                | ModelId::HuggingFaceGlm53FlashTogether
359                | ModelId::HuggingFaceGlm53Together
360                | ModelId::HuggingFaceMinimaxM3Novita
361                | ModelId::StepFun5Preview
362                | ModelId::OpenRouterMoonshotaiKimiK3
363                | ModelId::MoonshotKimiK3
364                | ModelId::MergeGatewayMoonshotKimiK3
365                | ModelId::OllamaGlm53Cloud
366                | ModelId::OllamaGlm53FlashCloud
367                | ModelId::OllamaDeepSeekV41FlashCloud
368                | ModelId::OllamaMistralLarge4Cloud
369                | ModelId::OllamaMuseSparkOpenCloud
370                | ModelId::XaiGrok46
371                | ModelId::XaiGrok47
372                | ModelId::MergeGatewayXaiGrok46
373                | ModelId::MergeGatewayXaiGrok47
374                | ModelId::VercelSpacexaiGrok47
375                | ModelId::MergeGatewayXiaomimimoMimoV26Pro
376                | ModelId::MergeGatewayXiaomimimoMimoV26Flash
377                | ModelId::MergeGatewayMistralLarge4
378                | ModelId::MergeGatewayMetaMuseSparkOpen
379                | ModelId::HuggingFaceMuseSparkOpenBaseten
380        )
381    }
382
383    /// Determine whether the model is a reasoning-capable variant
384    pub fn is_reasoning_variant(&self) -> bool {
385        if let Some(meta) = self.openrouter_metadata() {
386            return meta.reasoning;
387        }
388        self.provider().supports_reasoning(&self.as_str())
389    }
390
391    /// Determine whether the model supports tool calls/function execution
392    pub fn supports_tool_calls(&self) -> bool {
393        if let Some(meta) = self.generated_capabilities() {
394            return meta.tool_call;
395        }
396        if let Some(meta) = self.openrouter_metadata() {
397            return meta.tool_call;
398        }
399        true
400    }
401
402    /// Ordered list of supported input modalities when VT Code has metadata for this model.
403    pub fn input_modalities(&self) -> &'static [&'static str] {
404        self.generated_capabilities().map(|meta| meta.input_modalities).unwrap_or(&[])
405    }
406
407    /// Get the generation/version string for this model
408    pub fn generation(&self) -> &'static str {
409        if let Some(meta) = self.openrouter_metadata() {
410            return meta.generation;
411        }
412        match self {
413            // Gemini generations
414            // OpenAI generations
415            ModelId::GPT6Astra | ModelId::GPT6Sol | ModelId::GPT6Luna => "6",
416            ModelId::GPT61Sol => "6.1",
417            ModelId::GPT56Sol | ModelId::GPT56Terra | ModelId::GPT56Luna => "5.6",
418            ModelId::OpenAIGptOss20b | ModelId::OpenAIGptOss120b => "5",
419            // Anthropic generations
420            ModelId::ClaudeSonnet5 => "5",
421            ModelId::ClaudeSonnet55 => "5.5",
422            ModelId::ClaudeHaiku55 => "5.5",
423            ModelId::ClaudeFable5 => "5",
424            ModelId::ClaudeFable51 => "5.1",
425            ModelId::ClaudeOpus5 => "5",
426            ModelId::ClaudeOpus55 => "5.5",
427            // DeepSeek generations
428            ModelId::DeepSeekFlash => "4",
429            ModelId::OllamaDeepSeekV41FlashCloud => "4.1",
430            // Mistral generations
431            ModelId::MistralLarge3 => "3",
432            ModelId::MistralLarge4 => "4",
433            ModelId::OllamaMistralLarge4Cloud => "4",
434            ModelId::MergeGatewayDeepseekFlash => "4.1",
435            ModelId::MetaMuseSpark11 => "Muse-Spark-1.1",
436            ModelId::MetaMuseSpark13 | ModelId::MetaMuseSpark13Contributor => "Muse-Spark-1.3",
437            ModelId::MergeGatewayMetaMuseSparkOpen | ModelId::HuggingFaceMuseSparkOpenBaseten => "Muse-Spark-Open",
438            ModelId::OllamaMuseSparkOpenCloud => "Muse-Spark-Open",
439            ModelId::MetaMuseWonder10 => "Muse-Wonder-1.0",
440            ModelId::MetaMuseWonderFull10 => "Muse-Wonder-Full-1.0",
441            // Z.AI generations
442            ModelId::ZaiGlm53
443            | ModelId::ZaiGlm53Flash
444            | ModelId::ZaiGlm53Flashx
445            | ModelId::MergeGatewayZaiGlm53Flash
446            | ModelId::MergeGatewayZaiGlm53Flashx => "5.3",
447            ModelId::OllamaGlm53FlashCloud => "5.3",
448            ModelId::Gemini38Flash => "3.8",
449            ModelId::MergeGatewayGoogleGemini38Flash => "3.8",
450            ModelId::Gemini4Argon => "4",
451            ModelId::MergeGatewayGoogleGemini4Argon => "4",
452            ModelId::OpenCodeGoGlm53 => "5.3",
453            ModelId::OpenCodeGoGpt56Luna => "5.6-luna",
454            ModelId::OpenCodeGoKimiK3 => "k3",
455            ModelId::MiMoV26Pro | ModelId::MiMoV26Flash | ModelId::MiMoV26ProUltraspeed => "v2.6",
456            ModelId::MergeGatewayXiaomimimoMimoV26Pro | ModelId::MergeGatewayXiaomimimoMimoV26Flash => "v2.6",
457            ModelId::MergeGatewayMistralLarge4 => "4",
458            ModelId::OpenCodeGoMinimaxM3 => "m3",
459            ModelId::OllamaGptOss20b => "oss",
460            ModelId::OllamaGptOss20bCloud => "oss-cloud",
461            ModelId::OllamaGptOss120bCloud => "oss-cloud",
462            ModelId::OllamaMinimaxM3Cloud => "minimax-m3",
463            ModelId::OllamaGlm53Cloud => "glm-5.3",
464            ModelId::OllamaGemma4 => "gemma-4",
465            ModelId::LlamaCppGemma426bA4b => "4",
466            ModelId::LlamaCppGemma4E4b => "4",
467            ModelId::LlamaCppGptOss20b => "oss",
468            // MiniMax models
469            ModelId::MinimaxM3 => "M3",
470            // StepFun models
471            ModelId::StepFun37Flash => "3.7",
472            ModelId::StepFun5Preview => "5",
473            // Moonshot models
474            ModelId::MoonshotKimiK3 => "k3",
475            ModelId::MergeGatewayMoonshotKimiK3 => "k3",
476            // Hugging Face generations
477            ModelId::HuggingFaceOpenAIGptOss20b => "oss",
478            ModelId::HuggingFaceOpenAIGptOss120b => "oss",
479            ModelId::HuggingFaceMinimaxM3Novita => "m3",
480            ModelId::HuggingFaceGlm53FlashTogether => "5.3",
481            ModelId::HuggingFaceGlm53Together => "5.3",
482            // xAI models
483            ModelId::XaiGrok46 => "4.6",
484            ModelId::XaiGrok47 => "4.7",
485            ModelId::MergeGatewayXaiGrok46 => "4.6",
486            ModelId::MergeGatewayXaiGrok47 => "4.7",
487            // Qwen models
488            ModelId::MergeGatewayDefaultRouting => "routing",
489            ModelId::MergeGatewayAnthropicClaudeOpus5 => "5",
490            ModelId::MergeGatewayAnthropicClaudeOpus55 => "5.5",
491            ModelId::MergeGatewayAnthropicClaudeSonnet5 => "5",
492            ModelId::MergeGatewayAnthropicClaudeSonnet55 => "5.5",
493            ModelId::MergeGatewayAnthropicClaudeHaiku55 => "5.5",
494            ModelId::MergeGatewayAnthropicClaudeFable51 => "5.1",
495            ModelId::MergeGatewayAnthropicClaudeHaiku4520251001 => "4.5",
496            ModelId::MergeGatewayMinimaxH3 => "H3",
497            ModelId::MergeGatewayThinkingMachinesInkling => "Inkling",
498            ModelId::MergeGatewayOpenAIGpt56Luna
499            | ModelId::MergeGatewayOpenAIGpt56Sol
500            | ModelId::MergeGatewayOpenAIGpt56Terra => "5.6",
501            ModelId::MergeGatewayOpenAIGpt6Astra
502            | ModelId::MergeGatewayOpenAIGpt6Sol
503            | ModelId::MergeGatewayOpenAIGpt6Luna => "6",
504            ModelId::MergeGatewayOpenAIGpt61Sol => "6.1",
505            // Vercel AI Gateway models
506            ModelId::VercelAnthropicClaudeSonnet5 => "5",
507            ModelId::VercelAnthropicClaudeOpus5 => "5",
508            ModelId::VercelAnthropicClaudeOpus55 => "5.5",
509            ModelId::VercelAnthropicClaudeHaiku45 => "4.5",
510            ModelId::VercelOpenAiGpt56Sol | ModelId::VercelOpenAiGpt56Luna => "5.6",
511            ModelId::VercelOpenAiGpt6Astra => "6",
512            ModelId::VercelGoogleGemini38Flash => "3.8",
513            ModelId::VercelDeepseekFlash => "4.1",
514            ModelId::VercelMoonshotaiKimiK3 => "k3",
515            ModelId::VercelMinimaxM3 => "M3",
516            ModelId::VercelSpacexaiGrok47 => "4.7",
517            _ => "unknown",
518        }
519    }
520
521    /// Determine if this model supports GPT-5.1+/5.2+/5.3+ shell tool type
522    pub(crate) fn supports_shell_tool(&self) -> bool {
523        matches!(
524            self,
525            ModelId::GPT6Astra
526                | ModelId::GPT6Sol
527                | ModelId::GPT61Sol
528                | ModelId::GPT6Luna
529                | ModelId::GPT56Sol
530                | ModelId::GPT56Terra
531                | ModelId::GPT56Luna
532        )
533    }
534
535    /// Determine if this model supports optimized apply_patch tool
536    pub fn supports_apply_patch_tool(&self) -> bool {
537        false
538    }
539}
540
541#[cfg(test)]
542mod tests {
543    use super::*;
544
545    #[test]
546    fn prefixed_request_model_resolves_on_bare_provider() {
547        // Regression for `openai/gpt-5.6-luna` on provider `openai` resolving
548        // to empty `supported:` and omitting reasoning effort: exact bare hit
549        // and prefixed fallback must agree, while gateway prefixed entries
550        // keep their exact match.
551        let bare = model_catalog_entry("openai", "gpt-5.6-luna").expect("bare openai entry exists");
552        let prefixed = model_catalog_entry("openai", "openai/gpt-5.6-luna").expect("prefixed fallback must resolve");
553        assert_eq!(bare.reasoning_efforts, prefixed.reasoning_efforts);
554        assert!(!prefixed.reasoning_efforts.is_empty());
555
556        let gateway =
557            model_catalog_entry("merge-gateway", "openai/gpt-5.6-luna").expect("gateway prefixed entry exists");
558        assert!(!gateway.reasoning_efforts.is_empty());
559
560        // Asymmetric boundary: unknown model stays missing on both shapes,
561        // and an unrelated prefix must not resolve to the bare model.
562        assert!(model_catalog_entry("openai", "no-such-model-xyz").is_none());
563        assert!(model_catalog_entry("openai", "openai/no-such-model-xyz").is_none());
564        assert!(model_catalog_entry("openai", "other-org/gpt-5.6-luna").is_none());
565    }
566}