{"record":{"id":"6d3a943c6d1ab0bc","repo":"Significant-Gravitas/AutoGPT","slug":"you-ve-used-all-config-max-daily-resets-resets-f","errorCode":null,"errorMessage":"You've used all {config.max_daily_resets} resets for today.","messagePattern":"You've used all (.+?) resets for today\\.","errorType":"http","errorClass":"HTTPException","httpStatus":429,"severity":"warning","filePath":"autogpt_platform/backend/backend/api/features/chat/routes.py","lineNumber":1061,"sourceCode":"    )\n\n    if daily_limit <= 0:\n        raise HTTPException(\n            status_code=400,\n            detail=\"No daily limit is configured — nothing to reset.\",\n        )\n\n    # Check max daily resets.  get_daily_reset_count returns None when Redis\n    # is unavailable; reject the reset in that case to prevent unlimited\n    # free resets when the counter store is down.\n    reset_count = await get_daily_reset_count(user_id)\n    if reset_count is None:\n        raise HTTPException(\n            status_code=503,\n            detail=\"Unable to verify reset eligibility — please try again later.\",\n        )\n    if config.max_daily_resets > 0 and reset_count >= config.max_daily_resets:\n        raise HTTPException(\n            status_code=429,\n            detail=f\"You've used all {config.max_daily_resets} resets for today.\",\n        )\n\n    # Acquire a per-user lock to prevent TOCTOU races (concurrent resets).\n    if not await acquire_reset_lock(user_id):\n        raise HTTPException(\n            status_code=429,\n            detail=\"A reset is already in progress. Please try again.\",\n        )\n\n    try:\n        # Verify the user is actually at or over their daily limit.\n        # (rate_limit_reset_cost intentionally omitted — this object is only\n        # used for limit checks, not returned to the client.)\n        usage_status = await get_usage_status(\n            user_id=user_id,\n            daily_cost_limit=daily_limit,","sourceCodeStart":1043,"sourceCodeEnd":1079,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/chat/routes.py#L1043-L1079","documentation":"HTTP 429 from POST /usage/reset (routes.py:1061). The paid reset is capped per day by `max_daily_resets` (default 5, backend/copilot/config.py:380, '0 = unlimited'). When the user's Redis-tracked reset count for today is >= the cap, the endpoint rejects further resets for the rest of the UTC day. This prevents whales from infinitely buying resets.","triggerScenarios":"The user has already performed config.max_daily_resets successful resets today (count tracked via increment_daily_reset_count) and calls /usage/reset again. max_daily_resets > 0 (default 5).","commonSituations":"Heavy CoPilot users burning through their daily cost cap 5+ times in one day; scripts or automations retrying resets; support tickets from power users the day after a release that lowered the cap.","solutions":["Wait for the UTC-day rollover — the Redis counter (and the daily usage window) resets daily.","If the product intent allows more resets, raise max_daily_resets in backend/copilot/config.py (or its env var).","Client-side: parse the 429 detail ('You've used all N resets for today.') and show the remaining-reset count from the usage status instead of the button."],"exampleFix":"# before\nmax_daily_resets: int = Field(default=5, ge=0)\n\n# after — allow more paid resets per day\nmax_daily_resets: int = Field(default=10, ge=0)","handlingStrategy":"try-catch","validationCode":"// surface remaining resets before the call if the status exposes the count\nconst usage = await getUsageStatus();\nif (usage.resets_used >= usage.max_daily_resets) {\n  showCountdownToUtcMidnight();\n} else {\n  await post('/chat/usage/reset');\n}","typeGuard":null,"tryCatchPattern":"try { await post('/chat/usage/reset'); } catch (e) { if (e.status === 429 && /resets for today/.test(e.detail)) { showDailyCapReached(); return; } throw e; }","preventionTips":["Show reset count remaining in the UI before users hit the cap","Never auto-retry a 429 daily-cap response","Track that the cap resets at UTC midnight when displaying messaging"],"tags":["http","rate-limit","credits","config","fastapi"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}