From c75920a071fb66733f177e7511a78ed00d466cf3 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Mon, 22 Sep 2025 11:52:45 -0700 Subject: [PATCH] Change limits warning copy (#4059) --- codex-rs/tui/src/chatwidget.rs | 4 ++-- codex-rs/tui/src/chatwidget/tests.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index 480380b2..f5b95e53 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -128,7 +128,7 @@ impl RateLimitWarningState { { let threshold = RATE_LIMIT_WARNING_THRESHOLDS[self.weekly_index]; warnings.push(format!( - "Weekly usage exceeded {threshold:.0}% of the limit. Check /status to review usage." + "Heads up, you've used over {threshold:.0}% of your weekly limit. Run /status for a breakdown." )); self.weekly_index += 1; } @@ -138,7 +138,7 @@ impl RateLimitWarningState { { let threshold = RATE_LIMIT_WARNING_THRESHOLDS[self.hourly_index]; warnings.push(format!( - "Hourly usage exceeded {threshold:.0}% of the limit. Check /status to review usage." + "Heads up, you've used over {threshold:.0}% of your 5h limit. Run /status for a breakdown." )); self.hourly_index += 1; } diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index 284e20f4..2837cedc 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -397,26 +397,26 @@ fn rate_limit_warnings_emit_thresholds() { assert!( warnings .iter() - .any(|w| w.contains("Hourly usage exceeded 50%")), - "expected hourly 50% warning" + .any(|w| w.contains("Heads up, you've used over 50% of your 5h limit.")), + "expected hourly 50% warning (new copy)" ); assert!( warnings .iter() - .any(|w| w.contains("Weekly usage exceeded 50%")), - "expected weekly 50% warning" + .any(|w| w.contains("Heads up, you've used over 50% of your weekly limit.")), + "expected weekly 50% warning (new copy)" ); assert!( warnings .iter() - .any(|w| w.contains("Hourly usage exceeded 90%")), - "expected hourly 90% warning" + .any(|w| w.contains("Heads up, you've used over 90% of your 5h limit.")), + "expected hourly 90% warning (new copy)" ); assert!( warnings .iter() - .any(|w| w.contains("Weekly usage exceeded 90%")), - "expected weekly 90% warning" + .any(|w| w.contains("Heads up, you've used over 90% of your weekly limit.")), + "expected weekly 90% warning (new copy)" ); }