From 470b13c26fd46bcc8fe40e0647e81943714a4f04 Mon Sep 17 00:00:00 2001 From: kevin zhao Date: Mon, 27 Oct 2025 14:43:54 -0700 Subject: [PATCH] normalizing model slug in get_model_info --- codex-rs/core/src/openai_model_info.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/openai_model_info.rs b/codex-rs/core/src/openai_model_info.rs index e0d0bfd1b2..33a8d403ba 100644 --- a/codex-rs/core/src/openai_model_info.rs +++ b/codex-rs/core/src/openai_model_info.rs @@ -37,8 +37,10 @@ impl ModelInfo { } pub(crate) fn get_model_info(model_family: &ModelFamily) -> Option { - let slug = model_family.slug.as_str(); - match slug { + let raw_slug = model_family.slug.as_str(); + let slug = raw_slug.strip_prefix("openai/").unwrap_or(raw_slug); + let normalized_slug = slug.replace(':', "-"); + match normalized_slug.as_str() { // OSS models have a 128k shared token pool. // Arbitrarily splitting it: 3/4 input context, 1/4 output. // https://openai.com/index/gpt-oss-model-card/