chore: rename for clarity (#6319)

Co-authored-by: Ahmed Ibrahim <aibrahim@openai.com>
This commit is contained in:
Thibault Sottiaux
2025-11-06 08:32:57 -08:00
committed by GitHub
parent 667e841d3e
commit 649ce520c4
4 changed files with 19 additions and 10 deletions

View File

@@ -132,7 +132,7 @@ struct RunningCommand {
}
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;
#[derive(Default)]

View File

@@ -1,12 +1,13 @@
---
source: tui/src/chatwidget/tests.rs
assertion_line: 474
assertion_line: 480
expression: popup
---
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
Press enter to confirm or esc to go back

View File

@@ -411,6 +411,8 @@ fn test_rate_limit_warnings_monthly() {
#[test]
fn rate_limit_switch_prompt_skips_when_on_lower_cost_model() {
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.on_rate_limit_snapshot(Some(snapshot(95.0)));
@@ -423,8 +425,10 @@ fn rate_limit_switch_prompt_skips_when_on_lower_cost_model() {
#[test]
fn rate_limit_switch_prompt_shows_once_per_session() {
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
let (mut chat, _, _) = make_chatwidget_manual();
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)));
assert!(
@@ -446,8 +450,10 @@ fn rate_limit_switch_prompt_shows_once_per_session() {
#[test]
fn rate_limit_switch_prompt_defers_until_task_complete() {
let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();
let (mut chat, _, _) = make_chatwidget_manual();
chat.config.model = "gpt-5".to_string();
chat.auth_manager = AuthManager::from_auth_for_testing(auth);
chat.bottom_pane.set_task_running(true);
chat.on_rate_limit_snapshot(Some(snapshot(90.0)));
@@ -467,6 +473,8 @@ fn rate_limit_switch_prompt_defers_until_task_complete() {
#[test]
fn rate_limit_switch_prompt_popup_snapshot() {
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.on_rate_limit_snapshot(Some(snapshot(92.0)));