{"record":{"id":"d81e6de8a7a103ec","repo":"Significant-Gravitas/AutoGPT","slug":"you-ve-reached-the-limit-of-resolved-active-task","errorCode":null,"errorMessage":"You've reached the limit of {resolved} active tasks (running + queued). Please wait for one of your current tasks to finish before starting a new one.","messagePattern":"You've reached the limit of (.+?) active tasks \\(running \\+ queued\\)\\. Please wait for one of your current tasks to finish before starting a new one\\.","errorType":"http","errorClass":"HTTPException","httpStatus":429,"severity":"warning","filePath":"autogpt_platform/backend/backend/api/features/chat/routes.py","lineNumber":1545,"sourceCode":"                session_id=session_id,\n                message=request.message,\n                message_id=request.message_id,\n                is_user_message=request.is_user_message,\n                context=request.context,\n                file_ids=sanitized_file_ids,\n                mode=request.mode,\n                model=request.model,\n                llm_auth_provider=session.metadata.llm_auth_provider,\n                llm_credential_id=session.metadata.llm_credential_id,\n                permissions=(\n                    builder_permissions.model_dump(exclude_none=True)\n                    if builder_permissions\n                    else None\n                ),\n                request_arrival_at=request_arrival_at,\n            )\n        except turn_queue.InflightCapExceeded:\n            raise HTTPException(\n                status_code=429,\n                detail=inflight_turn_limit_message(inflight_cap),\n            )\n        logger.info(\n            f\"[STREAM] Queued turn for session={session_id} \"\n            f\"(running cap reached; inflight cap={inflight_cap})\"\n        )\n        return _empty_ui_message_stream_response()\n\n    if turn_id is None:\n        logger.info(\n            f\"[STREAM] Duplicate message detected for session {session_id}, skipping enqueue\"\n        )\n    else:\n        log_meta[\"turn_id\"] = turn_id\n\n    setup_time = (time.perf_counter() - stream_start_time) * 1000\n    logger.info(","sourceCodeStart":1527,"sourceCodeEnd":1563,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/chat/routes.py#L1527-L1563","documentation":"HTTP 429 from POST /chat/stream (routes.py:1545). The CoPilot turn queue enforces an inflight cap per user: running + queued turns must stay under inflight_cap. When enqueueing would exceed it, the queue raises turn_queue.InflightCapExceeded and the route surfaces inflight_turn_limit_message(inflight_cap) — 'You've reached the limit of {resolved} active tasks (running + queued)...'. The turn is not lost-before-enqueue; the server has already fallen back to queueing (the log line notes 'running cap reached'), and this is the hard stop beyond that.","triggerScenarios":"Posting new /chat/stream turns (or fan-out task launches within a turn) while the user already has inflight_cap turns in running+queued state — e.g. automations launching many parallel agent tasks from one session.","commonSituations":"Power users launching parallel sub-agent tasks; a client bug re-submitting turns; long-running agent tasks accumulating in the queue so new sends bounce.","solutions":["Wait for one of the current running/queued tasks to finish, then resend — the message says exactly this.","Client-side: poll active task/turn counts for the session and disable the send button at the cap.","If the product needs more parallelism, raise the per-user inflight cap in the turn-queue configuration.","Check for stuck turns: a turn that never completes permanently consumes a slot — inspect the stream registry/queue if the cap never frees up."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// track active tasks client-side before sending\nconst active = runningTurns + queuedTurns;\nif (active >= INFLIGHT_CAP) {\n  showToast('Wait for a running task to finish');\n} else {\n  await post('/chat/stream', body);\n}","typeGuard":null,"tryCatchPattern":"try { await post('/chat/stream', body); } catch (e) { if (e.status === 429 && /active tasks/.test(e.detail)) { showActiveTaskList(); return; } throw e; }","preventionTips":["Render the user's running+queued task count in the chat UI","Don't auto-retry — a slot frees only when a task completes","Watch for stuck turns that never release their inflight slot"],"tags":["http","rate-limit","concurrency","queue","chat","fastapi"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}