Change limits warning copy (#4059)

This commit is contained in:
Ahmed Ibrahim
2025-09-22 11:52:45 -07:00
committed by GitHub
parent 8daba53808
commit c75920a071
2 changed files with 10 additions and 10 deletions

View File

@@ -128,7 +128,7 @@ impl RateLimitWarningState {
{ {
let threshold = RATE_LIMIT_WARNING_THRESHOLDS[self.weekly_index]; let threshold = RATE_LIMIT_WARNING_THRESHOLDS[self.weekly_index];
warnings.push(format!( 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; self.weekly_index += 1;
} }
@@ -138,7 +138,7 @@ impl RateLimitWarningState {
{ {
let threshold = RATE_LIMIT_WARNING_THRESHOLDS[self.hourly_index]; let threshold = RATE_LIMIT_WARNING_THRESHOLDS[self.hourly_index];
warnings.push(format!( 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; self.hourly_index += 1;
} }

View File

@@ -397,26 +397,26 @@ fn rate_limit_warnings_emit_thresholds() {
assert!( assert!(
warnings warnings
.iter() .iter()
.any(|w| w.contains("Hourly usage exceeded 50%")), .any(|w| w.contains("Heads up, you've used over 50% of your 5h limit.")),
"expected hourly 50% warning" "expected hourly 50% warning (new copy)"
); );
assert!( assert!(
warnings warnings
.iter() .iter()
.any(|w| w.contains("Weekly usage exceeded 50%")), .any(|w| w.contains("Heads up, you've used over 50% of your weekly limit.")),
"expected weekly 50% warning" "expected weekly 50% warning (new copy)"
); );
assert!( assert!(
warnings warnings
.iter() .iter()
.any(|w| w.contains("Hourly usage exceeded 90%")), .any(|w| w.contains("Heads up, you've used over 90% of your 5h limit.")),
"expected hourly 90% warning" "expected hourly 90% warning (new copy)"
); );
assert!( assert!(
warnings warnings
.iter() .iter()
.any(|w| w.contains("Weekly usage exceeded 90%")), .any(|w| w.contains("Heads up, you've used over 90% of your weekly limit.")),
"expected weekly 90% warning" "expected weekly 90% warning (new copy)"
); );
} }