Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Change limits warning copy (#4059)

Ahmed Ibrahimc75920a071fb
diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs
index 480380b207..f5b95e5323 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 284e20f401..2837cedc25 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)"
);
}