Lightweight coding agent that runs in your terminal
Rust
feat: support verbosity in model_family (#5821)
jif-oai3e50f94d7683
diff --git a/codex-rs/core/src/client.rs b/codex-rs/core/src/client.rsindex cc40ef4261..a947e342ad 100644--- a/codex-rs/core/src/client.rs+++ b/codex-rs/core/src/client.rs@@ -223,18 +223,14 @@ impl ModelClient {let input_with_instructions = prompt.get_formatted_input();- let verbosity = match &self.config.model_family.family {- family if family == "gpt-5" => self.config.model_verbosity,- _ => {- if self.config.model_verbosity.is_some() {- warn!(- "model_verbosity is set but ignored for non-gpt-5 model family: {}",- self.config.model_family.family- );- }-- None- }+ let verbosity = if self.config.model_family.support_verbosity {+ self.config.model_verbosity+ } else {+ warn!(+ "model_verbosity is set but ignored as the model does not support verbosity: {}",+ self.config.model_family.family+ );+ None};// Only include `text.verbosity` for GPT-5 family modelsdiff --git a/codex-rs/core/src/model_family.rs b/codex-rs/core/src/model_family.rsindex e6e5fbfdf2..76ed81b0c2 100644--- a/codex-rs/core/src/model_family.rs+++ b/codex-rs/core/src/model_family.rs@@ -54,6 +54,9 @@ pub struct ModelFamily {/// This is applied when computing the effective context window seen by/// consumers.pub effective_context_window_percent: i64,++ /// If the model family supports setting the verbosity level when using Responses API.+ pub support_verbosity: bool,}macro_rules! model_family {@@ -73,6 +76,7 @@ macro_rules! model_family {base_instructions: BASE_INSTRUCTIONS.to_string(),experimental_supported_tools: Vec::new(),effective_context_window_percent: 95,+ support_verbosity: false,};// apply overrides$(@@ -128,6 +132,7 @@ pub fn find_family_for_model(slug: &str) -> Option<ModelFamily> {"test_sync_tool".to_string(),],supports_parallel_tool_calls: true,+ support_verbosity: true,)// Internal models.@@ -144,6 +149,7 @@ pub fn find_family_for_model(slug: &str) -> Option<ModelFamily> {"read_file".to_string(),],supports_parallel_tool_calls: true,+ support_verbosity: true,)// Production models.@@ -154,12 +160,14 @@ pub fn find_family_for_model(slug: &str) -> Option<ModelFamily> {reasoning_summary_format: ReasoningSummaryFormat::Experimental,base_instructions: GPT_5_CODEX_INSTRUCTIONS.to_string(),apply_patch_tool_type: Some(ApplyPatchToolType::Freeform),+ support_verbosity: true,)} else if slug.starts_with("gpt-5") {model_family!(slug, "gpt-5",supports_reasoning_summaries: true,needs_special_apply_patch_instructions: true,+ support_verbosity: true,)} else {None@@ -179,5 +187,6 @@ pub fn derive_default_model_family(model: &str) -> ModelFamily {base_instructions: BASE_INSTRUCTIONS.to_string(),experimental_supported_tools: Vec::new(),effective_context_window_percent: 95,+ support_verbosity: false,}}