mirror of
https://github.com/openai/codex.git
synced 2026-04-29 00:55:38 +00:00
Express rate limit warning as % remaining (#7795)
<img width="342" height="264" alt="image" src="https://github.com/user-attachments/assets/f1e932ff-c550-47b3-9035-0299ada4998d" /> Earlier, the warning was expressed as consumed% whereas status was expressed as remaining%. This change brings the two into sync to minimize confusion and improve visual consistency.
This commit is contained in:
@@ -515,16 +515,16 @@ fn rate_limit_warnings_emit_thresholds() {
|
||||
warnings,
|
||||
vec![
|
||||
String::from(
|
||||
"Heads up, you've used over 75% of your 5h limit. Run /status for a breakdown."
|
||||
"Heads up, you have less than 25% of your 5h limit left. Run /status for a breakdown."
|
||||
),
|
||||
String::from(
|
||||
"Heads up, you've used over 75% of your weekly limit. Run /status for a breakdown.",
|
||||
"Heads up, you have less than 25% of your weekly limit left. Run /status for a breakdown.",
|
||||
),
|
||||
String::from(
|
||||
"Heads up, you've used over 95% of your 5h limit. Run /status for a breakdown."
|
||||
"Heads up, you have less than 5% of your 5h limit left. Run /status for a breakdown."
|
||||
),
|
||||
String::from(
|
||||
"Heads up, you've used over 95% of your weekly limit. Run /status for a breakdown.",
|
||||
"Heads up, you have less than 5% of your weekly limit left. Run /status for a breakdown.",
|
||||
),
|
||||
],
|
||||
"expected one warning per limit for the highest crossed threshold"
|
||||
@@ -540,7 +540,7 @@ fn test_rate_limit_warnings_monthly() {
|
||||
assert_eq!(
|
||||
warnings,
|
||||
vec![String::from(
|
||||
"Heads up, you've used over 75% of your monthly limit. Run /status for a breakdown.",
|
||||
"Heads up, you have less than 25% of your monthly limit left. Run /status for a breakdown.",
|
||||
),],
|
||||
"expected one warning per limit for the highest crossed threshold"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user