mirror of
https://github.com/openai/codex.git
synced 2026-05-01 03:42:05 +03:00
fix: typos in model picker (#6859)
# External (non-OpenAI) Pull Request Requirements Before opening this Pull Request, please read the dedicated "Contributing" markdown file or your PR may be closed: https://github.com/openai/codex/blob/main/docs/contributing.md If your PR conforms to our contribution guidelines, replace this text with a detailed and high quality description of your changes. Include a link to a bug report or enhancement request.
This commit is contained in:
@@ -2013,6 +2013,26 @@ impl ChatWidget {
|
||||
let default_effort: ReasoningEffortConfig = preset.default_reasoning_effort;
|
||||
let supported = preset.supported_reasoning_efforts;
|
||||
|
||||
let warn_effort = if supported
|
||||
.iter()
|
||||
.any(|option| option.effort == ReasoningEffortConfig::XHigh)
|
||||
{
|
||||
Some(ReasoningEffortConfig::XHigh)
|
||||
} else if supported
|
||||
.iter()
|
||||
.any(|option| option.effort == ReasoningEffortConfig::High)
|
||||
{
|
||||
Some(ReasoningEffortConfig::High)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let warning_text = warn_effort.map(|effort| {
|
||||
let effort_label = Self::reasoning_effort_label(effort);
|
||||
format!("⚠ {effort_label} reasoning effort can quickly consume Plus plan rate limits.")
|
||||
});
|
||||
let warn_for_model =
|
||||
preset.model.starts_with("gpt-5.1-codex") || preset.model.starts_with("arcticfox");
|
||||
|
||||
struct EffortChoice {
|
||||
stored: Option<ReasoningEffortConfig>,
|
||||
display: ReasoningEffortConfig,
|
||||
@@ -2060,10 +2080,7 @@ impl ChatWidget {
|
||||
let mut items: Vec<SelectionItem> = Vec::new();
|
||||
for choice in choices.iter() {
|
||||
let effort = choice.display;
|
||||
let mut effort_label = effort.to_string();
|
||||
if let Some(first) = effort_label.get_mut(0..1) {
|
||||
first.make_ascii_uppercase();
|
||||
}
|
||||
let mut effort_label = Self::reasoning_effort_label(effort).to_string();
|
||||
if choice.stored == default_choice {
|
||||
effort_label.push_str(" (default)");
|
||||
}
|
||||
@@ -2078,14 +2095,17 @@ impl ChatWidget {
|
||||
})
|
||||
.filter(|text| !text.is_empty());
|
||||
|
||||
let warning = "⚠ High reasoning effort can quickly consume Plus plan rate limits.";
|
||||
let show_warning =
|
||||
preset.model.starts_with("gpt-5.1-codex") && effort == ReasoningEffortConfig::High;
|
||||
let selected_description = show_warning.then(|| {
|
||||
description
|
||||
.as_ref()
|
||||
.map_or(warning.to_string(), |d| format!("{d}\n{warning}"))
|
||||
});
|
||||
let show_warning = warn_for_model && warn_effort == Some(effort);
|
||||
let selected_description = if show_warning {
|
||||
warning_text.as_ref().map(|warning_message| {
|
||||
description.as_ref().map_or_else(
|
||||
|| warning_message.clone(),
|
||||
|d| format!("{d}\n{warning_message}"),
|
||||
)
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let model_for_action = model_slug.clone();
|
||||
let effort_for_action = choice.stored;
|
||||
@@ -2137,6 +2157,17 @@ impl ChatWidget {
|
||||
});
|
||||
}
|
||||
|
||||
fn reasoning_effort_label(effort: ReasoningEffortConfig) -> &'static str {
|
||||
match effort {
|
||||
ReasoningEffortConfig::None => "None",
|
||||
ReasoningEffortConfig::Minimal => "Minimal",
|
||||
ReasoningEffortConfig::Low => "Low",
|
||||
ReasoningEffortConfig::Medium => "Medium",
|
||||
ReasoningEffortConfig::High => "High",
|
||||
ReasoningEffortConfig::XHigh => "Extra high",
|
||||
}
|
||||
}
|
||||
|
||||
fn apply_model_and_effort(&self, model: String, effort: Option<ReasoningEffortConfig>) {
|
||||
self.app_event_tx
|
||||
.send(AppEvent::CodexOp(Op::OverrideTurnContext {
|
||||
|
||||
Reference in New Issue
Block a user