feat: bump tier limits -- free 1 repo/10K fn, pro 5, enterprise 10 (OPE-124)#277
Conversation
|
@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughTier resource limits were adjusted across backend and frontend: FREE and PRO repo limits reduced, FREE/PRO function limits increased, ENTERPRISE repo limit set to 10; frontend constants/types and a UsagePage CTA were updated to match. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/src/pages/UsagePage.tsx (1)
40-41:⚠️ Potential issue | 🟡 MinorFallback limits are stale after this tier-limit update.
Line 40 and Line 41 still default to the old Free limits (
3repos,2000functions). If the API payload is partial, the page will show incorrect plan limits.Suggested fix
- const repos = usage.repositories || { current: 0, limit: 3 } - const limits = usage.limits || { max_files_per_repo: 500, max_functions_per_repo: 2000 } + const repos = usage.repositories || { current: 0, limit: 1 } + const limits = usage.limits || { max_files_per_repo: 2000, max_functions_per_repo: 10000 }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/pages/UsagePage.tsx` around lines 40 - 41, The fallback values for repos and limits (variables repos and limits derived from usage.repositories and usage.limits) are still the old Free-tier numbers; replace these hardcoded defaults with the updated plan defaults (or import a shared DEFAULT_PLAN_LIMITS constant) and ensure partial API payloads are merged with those defaults (e.g., use a merged object like {...DEFAULT_REPOS_FALLBACK, ...usage.repositories} and {...DEFAULT_LIMITS_FALLBACK, ...usage.limits} or equivalent nullish-coalescing) so the page shows correct limits even when the API returns a partial payload.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@frontend/src/pages/UsagePage.tsx`:
- Around line 40-41: The fallback values for repos and limits (variables repos
and limits derived from usage.repositories and usage.limits) are still the old
Free-tier numbers; replace these hardcoded defaults with the updated plan
defaults (or import a shared DEFAULT_PLAN_LIMITS constant) and ensure partial
API payloads are merged with those defaults (e.g., use a merged object like
{...DEFAULT_REPOS_FALLBACK, ...usage.repositories} and
{...DEFAULT_LIMITS_FALLBACK, ...usage.limits} or equivalent nullish-coalescing)
so the page shows correct limits even when the API returns a partial payload.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
backend/services/user_limits.pyfrontend/src/config/api.tsfrontend/src/pages/UsagePage.tsx
…(OPE-124) Free: 3 repos/500 files/2K fn -> 1 repo/2K files/10K fn Pro: 20 repos/5K files/20K fn -> 5 repos/5K files/100K fn Enterprise: unlimited/50K files/500K fn -> 10 repos/50K files/500K fn Free: one repo, fully indexed, real codebase experience. Pro: 100K functions covers even large monorepos like Effect-TS. Enterprise: 10 repos with massive limits per repo. Closes OPE-124
f95210f to
ddb603a
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
frontend/src/pages/UsagePage.tsx (1)
69-69: Avoid hardcoded plan limits in CTA copy.Line 69 hardcodes Pro limits in UI text. This is prone to drift when limits change again. Source this string (or at least the numeric limits) from shared tier-limit config so product copy and enforcement stay aligned.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/pages/UsagePage.tsx` at line 69, The CTA currently hardcodes Pro limits ("Pro: 5 repos, 100K functions/repo, Cohere reranking") in UsagePage.tsx; replace that literal with values pulled from the shared tier-limit configuration (e.g., import the shared PLAN_LIMITS or tierLimits object) and build the display string from its properties (repos, functionsPerRepo, rerankingFeature) inside the UsagePage component so UI copy stays in sync with enforcement; also provide a sensible fallback or localized formatter when the config keys are absent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@backend/services/user_limits.py`:
- Line 60: The Pro plan's max_functions_per_repo is incorrectly set to 100000;
update the Pro configuration in backend/services/user_limits.py so the
max_functions_per_repo for the Pro plan (where the Pro entry is defined—look for
the Pro key or constant in the user limits mapping) is 20000 to match the PR
objective, and run/adjust any related unit tests or fixtures that assert this
value (refer to the mapping or function that returns plan limits such as the Pro
entry in the limits dict).
---
Nitpick comments:
In `@frontend/src/pages/UsagePage.tsx`:
- Line 69: The CTA currently hardcodes Pro limits ("Pro: 5 repos, 100K
functions/repo, Cohere reranking") in UsagePage.tsx; replace that literal with
values pulled from the shared tier-limit configuration (e.g., import the shared
PLAN_LIMITS or tierLimits object) and build the display string from its
properties (repos, functionsPerRepo, rerankingFeature) inside the UsagePage
component so UI copy stays in sync with enforcement; also provide a sensible
fallback or localized formatter when the config keys are absent.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
backend/services/user_limits.pyfrontend/src/config/api.tsfrontend/src/pages/UsagePage.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- frontend/src/config/api.ts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
New Tier Limits
Why
Free tier at 2K functions couldn't index Flask, couldn't index our own repo. Users never saw the value. 1 repo with 10K functions lets them index a real codebase and experience semantic search on their actual code. That's the conversion trigger.
Cost: 10K functions = ~2M tokens = $0.04/user in OpenAI embeddings.
Files
3 files, 9 insertions, 9 deletions. Net zero lines.
Closes OPE-124
Summary by CodeRabbit