Skip to content

Commit ba9620a

Browse files
[codex] respect overrides for model family configuration from toml file (#3176)
1 parent 45c3b20 commit ba9620a

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

codex-rs/core/src/config.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -732,23 +732,24 @@ impl Config {
732732
.or(config_profile.model)
733733
.or(cfg.model)
734734
.unwrap_or_else(default_model);
735-
let model_family = find_family_for_model(&model).unwrap_or_else(|| {
736-
let supports_reasoning_summaries =
737-
cfg.model_supports_reasoning_summaries.unwrap_or(false);
738-
let reasoning_summary_format = cfg
739-
.model_reasoning_summary_format
740-
.unwrap_or(ReasoningSummaryFormat::None);
741-
ModelFamily {
742-
slug: model.clone(),
743-
family: model.clone(),
744-
needs_special_apply_patch_instructions: false,
745-
supports_reasoning_summaries,
746-
reasoning_summary_format,
747-
uses_local_shell_tool: false,
748-
apply_patch_tool_type: None,
749-
}
735+
736+
let mut model_family = find_family_for_model(&model).unwrap_or_else(|| ModelFamily {
737+
slug: model.clone(),
738+
family: model.clone(),
739+
needs_special_apply_patch_instructions: false,
740+
supports_reasoning_summaries: false,
741+
reasoning_summary_format: ReasoningSummaryFormat::None,
742+
uses_local_shell_tool: false,
743+
apply_patch_tool_type: None,
750744
});
751745

746+
if let Some(supports_reasoning_summaries) = cfg.model_supports_reasoning_summaries {
747+
model_family.supports_reasoning_summaries = supports_reasoning_summaries;
748+
}
749+
if let Some(model_reasoning_summary_format) = cfg.model_reasoning_summary_format {
750+
model_family.reasoning_summary_format = model_reasoning_summary_format;
751+
}
752+
752753
let openai_model_info = get_model_info(&model_family);
753754
let model_context_window = cfg
754755
.model_context_window

0 commit comments

Comments
 (0)