fix(platform): pass tier to get_usage_status() in reset_copilot_usage endpoint

The reset_copilot_usage endpoint was calling get_usage_status() without
the tier parameter, causing the response to always report STANDARD tier
regardless of the user's actual tier. Pass _tier from get_global_rate_limits()
to both get_usage_status() calls in the endpoint.
This commit is contained in:
Zamil Majdy
2026-03-27 01:37:01 +07:00
parent 19dea0e4ca
commit 4963d227ea

View File

@@ -533,6 +533,7 @@ async def reset_copilot_usage(
user_id=user_id,
daily_token_limit=daily_limit,
weekly_token_limit=weekly_limit,
tier=_tier,
)
if daily_limit > 0 and usage_status.daily.used < daily_limit:
raise HTTPException(
@@ -608,6 +609,7 @@ async def reset_copilot_usage(
daily_token_limit=daily_limit,
weekly_token_limit=weekly_limit,
rate_limit_reset_cost=config.rate_limit_reset_cost,
tier=_tier,
)
return RateLimitResetResponse(