From f3b4a26f32dd07411e5ac0bd10587f7543d07104 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Sun, 5 Oct 2025 17:26:04 +0100 Subject: [PATCH] chore: drop read-file for gpt-5-codex (#4739) Drop `read_file` for gpt-5-codex (will do the same for parallel tool call) and add `codex-` as internal model for this kind of feature --- codex-rs/core/src/model_family.rs | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/codex-rs/core/src/model_family.rs b/codex-rs/core/src/model_family.rs index 5387cf9d..ed3230e2 100644 --- a/codex-rs/core/src/model_family.rs +++ b/codex-rs/core/src/model_family.rs @@ -77,7 +77,11 @@ macro_rules! model_family { /// Returns a `ModelFamily` for the given model slug, or `None` if the slug /// does not match any known model family. -pub fn find_family_for_model(slug: &str) -> Option { +pub fn find_family_for_model(mut slug: &str) -> Option { + // TODO(jif) clean once we have proper feature flags + if matches!(std::env::var("CODEX_EXPERIMENTAL").as_deref(), Ok("1")) { + slug = "codex-experimental"; + } if slug.starts_with("o3") { model_family!( slug, "o3", @@ -120,15 +124,27 @@ pub fn find_family_for_model(slug: &str) -> Option { ], supports_parallel_tool_calls: true, ) - } else if slug.starts_with("codex-") || slug.starts_with("gpt-5-codex") { + + // Internal models. + } else if slug.starts_with("codex-") { + model_family!( + slug, slug, + supports_reasoning_summaries: true, + reasoning_summary_format: ReasoningSummaryFormat::Experimental, + base_instructions: GPT_5_CODEX_INSTRUCTIONS.to_string(), + apply_patch_tool_type: Some(ApplyPatchToolType::Freeform), + experimental_supported_tools: vec!["read_file".to_string()], + supports_parallel_tool_calls: true, + ) + + // Production models. + } else if slug.starts_with("gpt-5-codex") { model_family!( slug, slug, supports_reasoning_summaries: true, reasoning_summary_format: ReasoningSummaryFormat::Experimental, base_instructions: GPT_5_CODEX_INSTRUCTIONS.to_string(), apply_patch_tool_type: Some(ApplyPatchToolType::Freeform), - // experimental_supported_tools: vec!["read_file".to_string()], - // supports_parallel_tool_calls: true, ) } else if slug.starts_with("gpt-5") { model_family!(