chore: rename for clarity (#6319)
Co-authored-by: Ahmed Ibrahim <aibrahim@openai.com>
This commit is contained in:
committed by
GitHub
parent
667e841d3e
commit
649ce520c4
@@ -53,10 +53,10 @@ const PRESETS: &[ModelPreset] = &[
|
|||||||
is_default: true,
|
is_default: true,
|
||||||
},
|
},
|
||||||
ModelPreset {
|
ModelPreset {
|
||||||
id: "desertfox",
|
id: "gpt-5-codex-mini",
|
||||||
model: "desertfox",
|
model: "gpt-5-codex-mini",
|
||||||
display_name: "desertfox",
|
display_name: "gpt-5-codex-mini",
|
||||||
description: "???",
|
description: "Optimized for codex. Cheaper, faster, and less capable.",
|
||||||
default_reasoning_effort: ReasoningEffort::Medium,
|
default_reasoning_effort: ReasoningEffort::Medium,
|
||||||
supported_reasoning_efforts: &[
|
supported_reasoning_efforts: &[
|
||||||
ReasoningEffortPreset {
|
ReasoningEffortPreset {
|
||||||
@@ -99,10 +99,10 @@ const PRESETS: &[ModelPreset] = &[
|
|||||||
];
|
];
|
||||||
|
|
||||||
pub fn builtin_model_presets(auth_mode: Option<AuthMode>) -> Vec<ModelPreset> {
|
pub fn builtin_model_presets(auth_mode: Option<AuthMode>) -> Vec<ModelPreset> {
|
||||||
let allow_desertfox = matches!(auth_mode, Some(AuthMode::ChatGPT));
|
let allow_codex_mini = matches!(auth_mode, Some(AuthMode::ChatGPT));
|
||||||
PRESETS
|
PRESETS
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|preset| allow_desertfox || preset.id != "desertfox")
|
.filter(|preset| allow_codex_mini || preset.id != "gpt-5-codex-mini")
|
||||||
.copied()
|
.copied()
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ struct RunningCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const RATE_LIMIT_WARNING_THRESHOLDS: [f64; 3] = [75.0, 90.0, 95.0];
|
const RATE_LIMIT_WARNING_THRESHOLDS: [f64; 3] = [75.0, 90.0, 95.0];
|
||||||
const NUDGE_MODEL_SLUG: &str = "gpt-5-codex";
|
const NUDGE_MODEL_SLUG: &str = "gpt-5-codex-mini";
|
||||||
const RATE_LIMIT_SWITCH_PROMPT_THRESHOLD: f64 = 90.0;
|
const RATE_LIMIT_SWITCH_PROMPT_THRESHOLD: f64 = 90.0;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
---
|
---
|
||||||
source: tui/src/chatwidget/tests.rs
|
source: tui/src/chatwidget/tests.rs
|
||||||
assertion_line: 474
|
assertion_line: 480
|
||||||
expression: popup
|
expression: popup
|
||||||
---
|
---
|
||||||
Approaching rate limits
|
Approaching rate limits
|
||||||
You've used over 90% of your limit. Switch to gpt-5-codex for lower credit u
|
You've used over 90% of your limit. Switch to gpt-5-codex-mini for lower cre
|
||||||
|
|
||||||
› 1. Switch to gpt-5-codex Optimized for codex.
|
› 1. Switch to gpt-5-codex-mini Optimized for codex. Cheaper, faster, and
|
||||||
|
less capable.
|
||||||
2. Keep current model
|
2. Keep current model
|
||||||
|
|
||||||
Press enter to confirm or esc to go back
|
Press enter to confirm or esc to go back
|
||||||
|
|||||||
@@ -411,6 +411,8 @@ fn test_rate_limit_warnings_monthly() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn rate_limit_switch_prompt_skips_when_on_lower_cost_model() {
|
fn rate_limit_switch_prompt_skips_when_on_lower_cost_model() {
|
||||||
let (mut chat, _, _) = make_chatwidget_manual();
|
let (mut chat, _, _) = make_chatwidget_manual();
|
||||||
|
chat.auth_manager =
|
||||||
|
AuthManager::from_auth_for_testing(CodexAuth::create_dummy_chatgpt_auth_for_testing());
|
||||||
chat.config.model = NUDGE_MODEL_SLUG.to_string();
|
chat.config.model = NUDGE_MODEL_SLUG.to_string();
|
||||||
|
|
||||||
chat.on_rate_limit_snapshot(Some(snapshot(95.0)));
|
chat.on_rate_limit_snapshot(Some(snapshot(95.0)));
|
||||||
@@ -423,8 +425,10 @@ fn rate_limit_switch_prompt_skips_when_on_lower_cost_model() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rate_limit_switch_prompt_shows_once_per_session() {
|
fn rate_limit_switch_prompt_shows_once_per_session() {
|
||||||
|
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
|
||||||
let (mut chat, _, _) = make_chatwidget_manual();
|
let (mut chat, _, _) = make_chatwidget_manual();
|
||||||
chat.config.model = "gpt-5".to_string();
|
chat.config.model = "gpt-5".to_string();
|
||||||
|
chat.auth_manager = AuthManager::from_auth_for_testing(auth);
|
||||||
|
|
||||||
chat.on_rate_limit_snapshot(Some(snapshot(90.0)));
|
chat.on_rate_limit_snapshot(Some(snapshot(90.0)));
|
||||||
assert!(
|
assert!(
|
||||||
@@ -446,8 +450,10 @@ fn rate_limit_switch_prompt_shows_once_per_session() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rate_limit_switch_prompt_defers_until_task_complete() {
|
fn rate_limit_switch_prompt_defers_until_task_complete() {
|
||||||
|
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
|
||||||
let (mut chat, _, _) = make_chatwidget_manual();
|
let (mut chat, _, _) = make_chatwidget_manual();
|
||||||
chat.config.model = "gpt-5".to_string();
|
chat.config.model = "gpt-5".to_string();
|
||||||
|
chat.auth_manager = AuthManager::from_auth_for_testing(auth);
|
||||||
|
|
||||||
chat.bottom_pane.set_task_running(true);
|
chat.bottom_pane.set_task_running(true);
|
||||||
chat.on_rate_limit_snapshot(Some(snapshot(90.0)));
|
chat.on_rate_limit_snapshot(Some(snapshot(90.0)));
|
||||||
@@ -467,6 +473,8 @@ fn rate_limit_switch_prompt_defers_until_task_complete() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn rate_limit_switch_prompt_popup_snapshot() {
|
fn rate_limit_switch_prompt_popup_snapshot() {
|
||||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual();
|
let (mut chat, _rx, _op_rx) = make_chatwidget_manual();
|
||||||
|
chat.auth_manager =
|
||||||
|
AuthManager::from_auth_for_testing(CodexAuth::create_dummy_chatgpt_auth_for_testing());
|
||||||
chat.config.model = "gpt-5".to_string();
|
chat.config.model = "gpt-5".to_string();
|
||||||
|
|
||||||
chat.on_rate_limit_snapshot(Some(snapshot(92.0)));
|
chat.on_rate_limit_snapshot(Some(snapshot(92.0)));
|
||||||
|
|||||||
Reference in New Issue
Block a user