mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user