diff --git a/README.md b/README.md index 873b220..900d040 100644 --- a/README.md +++ b/README.md @@ -376,7 +376,7 @@ make dev-serve # Start development servers | Plan | Price | Features | |------|-------|----------| -| **Free** | $0/mo | 20 agents/month, Core features | +| **Free** | $0/mo | 10 agents/month, Core features | | **Pro** | $9/mo | Unlimited agents, Priority support | | **Enterprise** | [Contact Us](https://cal.com/ishaan-sehgal-8kc22w/omnara-demo) | Teams, SSO, Custom integrations | diff --git a/backend/api/mobile_billing.py b/backend/api/mobile_billing.py index a809b57..4dbcb2a 100644 --- a/backend/api/mobile_billing.py +++ b/backend/api/mobile_billing.py @@ -221,7 +221,7 @@ def sync_subscription_status(subscriber_data: dict, db: Session) -> bool: # No active subscription - revert to free logger.info("No active Pro entitlement found, downgrading to free") subscription.plan_type = "free" - subscription.agent_limit = 20 + subscription.agent_limit = 10 subscription.provider = None # Clear provider when going to free subscription.provider_subscription_id = None # Clear subscription reference diff --git a/shared/alembic/versions/f903f2e200c9_update_free_tier_agent_limit_from_20_to_.py b/shared/alembic/versions/f903f2e200c9_update_free_tier_agent_limit_from_20_to_.py new file mode 100644 index 0000000..2bc57ab --- /dev/null +++ b/shared/alembic/versions/f903f2e200c9_update_free_tier_agent_limit_from_20_to_.py @@ -0,0 +1,36 @@ +"""Update free tier agent limit from 20 to 10 + +Revision ID: f903f2e200c9 +Revises: 20de0aa419ca +Create Date: 2025-08-09 13:41:40.430740 + +""" + +from typing import Sequence, Union + +from alembic import op + + +# revision identifiers, used by Alembic. +revision: str = "f903f2e200c9" +down_revision: Union[str, None] = "20de0aa419ca" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # Update all existing free tier subscriptions from 20 to 10 agents + op.execute(""" + UPDATE subscriptions + SET agent_limit = 10 + WHERE plan_type = 'free' AND agent_limit = 20 + """) + + +def downgrade() -> None: + # Revert free tier subscriptions back to 20 agents + op.execute(""" + UPDATE subscriptions + SET agent_limit = 20 + WHERE plan_type = 'free' AND agent_limit = 10 + """) diff --git a/shared/config/settings.py b/shared/config/settings.py index 3d9fafc..c01646c 100644 --- a/shared/config/settings.py +++ b/shared/config/settings.py @@ -99,7 +99,7 @@ class Settings(BaseSettings): ) # Plan Configuration - used when enforce_limits is True - free_plan_agent_limit: int = 20 # 20 total agents per month + free_plan_agent_limit: int = 10 # 10 total agents per month pro_plan_agent_limit: int = -1 # Unlimited pro_plan_price: float = 9 enterprise_plan_agent_limit: int = -1 # Unlimited diff --git a/shared/database/billing_operations.py b/shared/database/billing_operations.py index 5e36269..e9ba198 100644 --- a/shared/database/billing_operations.py +++ b/shared/database/billing_operations.py @@ -85,7 +85,7 @@ def get_or_create_subscription(user_id: UUID, db: Session) -> Subscription: """Get existing subscription or create a default free one.""" subscription = db.query(Subscription).filter_by(user_id=user_id).first() if not subscription: - # Create with defaults from model (plan_type="free", agent_limit=20) + # Create with defaults from model (plan_type="free", agent_limit=10) subscription = Subscription(user_id=user_id) db.add(subscription) db.commit() diff --git a/shared/database/subscription_models.py b/shared/database/subscription_models.py index e85f0c1..756eece 100644 --- a/shared/database/subscription_models.py +++ b/shared/database/subscription_models.py @@ -36,8 +36,8 @@ class Subscription(Base): # Limits - -1 means unlimited (default to free plan limits) agent_limit: Mapped[int] = mapped_column( - Integer, default=20 - ) # Free plan: 20 agents/month + Integer, default=10 + ) # Free plan: 10 agents/month # Payment provider information - minimal needed for operations provider: Mapped[str | None] = mapped_column(