Skip to content

Commit a6597a9

Browse files
Fix/correct reasoning display (#6749)
This closes #6748 by implementing fallback to `model_family.default_reasoning_effort` in `reasoning_effort` display of `/status` when no `model_reasoning_effort` is set in the configuration. ## common/src/config_summary.rs - `create_config_summary_entries` now fills the "reasoning effort" entry with the explicit `config.model_reasoning_effort` when present and falls back to `config.model_family.default_reasoning_effort` when it is `None`, instead of emitting the literal string `none`. - This ensures downstream consumers such as `tui/src/status/helpers.rs` continue to work unchanged while automatically picking up model-family defaults when the user has not selected a reasoning effort. ## tui/src/status/helpers.rs / core/src/model_family.rs `ModelFamily::default_reasoning_effort` metadata is set to `medium` for both `gpt-5*-codex` and `gpt-5` models following the default behaviour of the API and recommendation of the codebase: - per https://platform.openai.com/docs/api-reference/responses/create `gpt-5` defaults to `medium` reasoning when no preset is passed - there is no mention of the preset for `gpt-5.1-codex` in the API docs but `medium` is the default setting for `gpt-5.1-codex` as per `codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_reasoning_selection_popup.snap` --------- Signed-off-by: lionelchg <[email protected]> Co-authored-by: Eric Traut <[email protected]>
1 parent 692989c commit a6597a9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

codex-rs/common/src/config_summary.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ pub fn create_config_summary_entries(config: &Config) -> Vec<(&'static str, Stri
1515
if config.model_provider.wire_api == WireApi::Responses
1616
&& config.model_family.supports_reasoning_summaries
1717
{
18-
entries.push((
19-
"reasoning effort",
20-
config
21-
.model_reasoning_effort
22-
.map(|effort| effort.to_string())
23-
.unwrap_or_else(|| "none".to_string()),
24-
));
18+
let reasoning_effort = config
19+
.model_reasoning_effort
20+
.or(config.model_family.default_reasoning_effort)
21+
.map(|effort| effort.to_string())
22+
.unwrap_or_else(|| "none".to_string());
23+
entries.push(("reasoning effort", reasoning_effort));
2524
entries.push((
2625
"reasoning summaries",
2726
config.model_reasoning_summary.to_string(),

0 commit comments

Comments
 (0)