[codex] Support model-defined reasoning efforts (#26444)

## Summary
- accept non-empty model-defined reasoning effort values while
preserving built-in effort behavior
- propagate the non-Copy effort type through core, app-server, TUI,
telemetry, and persistence call sites
- preserve string wire encoding and expose an open-string schema for
clients
- update model selection and shortcut behavior for model-advertised
effort values

## Root cause
`ReasoningEffort` gained a string-backed custom variant, so it could no
longer implement `Copy` or rely on derived closed-enum serialization.
Existing consumers still moved effort values from shared references and
assumed a fixed built-in value set.

## Validation
- `just fmt`
- Local tests and compilation were not run per request; relying on CI.
This commit is contained in:
Ahmed Ibrahim
2026-06-04 13:36:24 -07:00
committed by GitHub
Unverified
parent 4a70e0ac1b
commit 8ac304c299
97 changed files with 685 additions and 581 deletions
@@ -446,7 +446,8 @@ fn config_summary_entries(
"reasoning effort",
config
.model_reasoning_effort
.map(|effort| effort.to_string())
.as_ref()
.map(std::string::ToString::to_string)
.unwrap_or_else(|| "none".to_string()),
));
entries.push((
+3 -3
View File
@@ -694,7 +694,7 @@ async fn run_exec_session(args: ExecRunArgs) -> anyhow::Result<()> {
let default_cwd = config.cwd.to_path_buf();
let default_approval_policy = config.permissions.approval_policy.value();
let default_effort = config.model_reasoning_effort;
let default_effort = config.model_reasoning_effort.clone();
let (initial_operation, prompt_summary) = match (command.as_ref(), prompt, images) {
(Some(ExecCommand::Review(review_cli)), _, _) => {
@@ -1169,7 +1169,7 @@ fn session_configured_from_thread_start_response(
config.permissions.effective_permission_profile(),
response.active_permission_profile.clone().map(Into::into),
response.cwd.clone(),
response.reasoning_effort,
response.reasoning_effort.clone(),
)
}
@@ -1192,7 +1192,7 @@ fn session_configured_from_thread_resume_response(
config.permissions.effective_permission_profile(),
response.active_permission_profile.clone().map(Into::into),
response.cwd.clone(),
response.reasoning_effort,
response.reasoning_effort.clone(),
)
}