{"record":{"id":"7aa838c72b2e6162","repo":"Significant-Gravitas/AutoGPT","slug":"no-daily-limit-is-configured-nothing-to-reset","errorCode":null,"errorMessage":"No daily limit is configured — nothing to reset.","messagePattern":"No daily limit is configured — nothing to reset\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/chat/routes.py","lineNumber":1046,"sourceCode":"        raise HTTPException(\n            status_code=400,\n            detail=\"Rate limit reset is not available.\",\n        )\n\n    if not settings.config.enable_credit:\n        raise HTTPException(\n            status_code=400,\n            detail=\"Rate limit reset is not available (credit system is disabled).\",\n        )\n\n    daily_limit, weekly_limit, tier = await get_global_rate_limits(\n        user_id,\n        config.daily_cost_limit_microdollars,\n        config.weekly_cost_limit_microdollars,\n    )\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        )","sourceCodeStart":1028,"sourceCodeEnd":1064,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/chat/routes.py#L1028-L1064","documentation":"HTTP 400 from POST /usage/reset (routes.py:1046). After fetching the user's effective limits via get_global_rate_limits, the endpoint checks that a daily cost limit exists (daily_limit > 0). If the resolved daily_cost_limit_microdollars is 0 there is no daily counter to clear, so the paid reset would buy nothing and the request is rejected. Note the config comment in copilot/config.py: '0 means no spend allowed', so a 0 limit can also come from tier overrides.","triggerScenarios":"Calling /usage/reset when the user's tier resolves daily_cost_limit_microdollars to 0 — either the global config default is 0 or the user's tier override sets 0. get_global_rate_limits(user_id, config.daily_cost_limit_microdollars, ...) returned 0 for the daily slot.","commonSituations":"Tier-based limit overrides that zero out the daily cap for trial/blocked tiers; a fresh deployment that never set DAILY_COST_LIMIT_MICRODOLLARS and defaults to 0; user confusion between 'blocked tier' (limit 0) and 'hit my limit'.","solutions":["Check the user's tier overrides and global config: set daily_cost_limit_microdollars to a positive value for that tier (backend/copilot/config.py:366 area or tier override source).","If a 0-limit tier is intentional (blocked users), surface that state in the UI as 'no daily allowance' instead of offering a paid reset.","Client-side: read the daily limit from the usage-status endpoint before offering the reset button."],"exampleFix":"# before\n# tier override zeroes the daily cap -> /usage/reset returns 400\ndaily_cost_limit_microdollars = 0\n\n# after\n# give the tier a real daily cap so the reset has meaning\ndaily_cost_limit_microdollars = 2_000_000  # $2.00/day in microdollars","handlingStrategy":"validation","validationCode":"// fetch effective limits before offering a reset\nconst usage = await getUsageStatus();\nif (usage.daily.limit <= 0) {\n  showNotice('Your plan has no daily allowance to reset');\n} else if (usage.daily.used >= usage.daily.limit) {\n  await post('/chat/usage/reset');\n}","typeGuard":null,"tryCatchPattern":"try { await post('/chat/usage/reset'); } catch (e) { if (e.status === 400 && /nothing to reset/.test(e.detail)) { showPlanNotice(); return; } throw e; }","preventionTips":["Drive the reset affordance from live usage-status data, not assumptions","Validate tier overrides expose positive daily limits before enabling the feature for that tier","Distinguish 'limit is 0' (blocked tier) from 'limit reached' in the UI"],"tags":["http","config","rate-limit","tier","fastapi"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}