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];
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;
}

View File

@@ -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)"
);
}