diff --git a/backend/agent/utils.py b/backend/agent/utils.py index 9162f138..9695adca 100644 --- a/backend/agent/utils.py +++ b/backend/agent/utils.py @@ -142,6 +142,16 @@ async def check_agent_run_limit(client, account_id: str) -> Dict[str, Any]: async def check_agent_count_limit(client, account_id: str) -> Dict[str, Any]: try: + # In local mode, allow practically unlimited custom agents + if config.ENV_MODE.value == "local": + logger.debug(f"Local mode detected - bypassing agent count limit for account {account_id}") + return { + 'can_create': True, + 'current_count': 0, # Return 0 to avoid showing any limit warnings + 'limit': 999999, # Practically unlimited + 'tier_name': 'local' + } + try: result = await Cache.get(f"agent_count_limit:{account_id}") if result: diff --git a/backend/utils/config.py b/backend/utils/config.py index 9344f9ef..852a3eaa 100644 --- a/backend/utils/config.py +++ b/backend/utils/config.py @@ -272,6 +272,7 @@ class Configuration: _MAX_PARALLEL_AGENT_RUNS_ENV: Optional[str] = None # Agent limits per billing tier + # Note: These limits are bypassed in local mode (ENV_MODE=local) where unlimited agents are allowed AGENT_LIMITS = { 'free': 2, 'tier_2_20': 5,