Skip to content

Conversation

@rossmanko
Copy link
Contributor

@rossmanko rossmanko commented Jan 31, 2026

  • Introduced 'pro-plus' subscription tier across various components and APIs.
  • Updated entitlement checks to include 'pro-plus' in subscription logic.
  • Modified pricing features and plan headers to reflect the new tier.
  • Adjusted user interface components to support 'pro-plus' features and upgrade paths.
  • Refactored related functions and types to accommodate the new subscription structure.

This change improves the flexibility of subscription offerings and enhances user experience by providing more options.

Summary by CodeRabbit

  • New Features

    • Introduced Pro+ subscription tier with monthly and yearly options and Pro+ selection across pricing, account, and upgrade UIs.
  • Updates

    • Updated plan copy, headers and feature lists to highlight Pro+ and adjust Free/Pro/Ultra/Team messaging.
    • Unified paid-plan limits for tokens/memory and improved rate-limit messages with contextual upgrade guidance.
    • Billing, badges, and upgrade flows now recognize and display Pro+.

✏️ Tip: You can customize this high-level summary in your review settings.

…ated logic

- Introduced 'pro-plus' subscription tier across various components and APIs.
- Updated entitlement checks to include 'pro-plus' in subscription logic.
- Modified pricing features and plan headers to reflect the new tier.
- Adjusted user interface components to support 'pro-plus' features and upgrade paths.
- Refactored related functions and types to accommodate the new subscription structure.

This change improves the flexibility of subscription offerings and enhances user experience by providing more options.
@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hackerai Ready Ready Preview, Comment Feb 1, 2026 1:30pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

Adds a new "pro-plus" subscription tier across types, entitlement detection, pricing, UI, upgrade flows, token/rate-limit logic, and backend entitlement checks; simplifies paid-plan token limits and removes an entitlement-based file limit helper.

Changes

Cohort / File(s) Summary
Type & Entitlement Core
types/chat.ts, app/api/entitlements/route.ts, lib/auth/get-user-id.ts, app/contexts/GlobalState.tsx
Introduce pro-plus to SubscriptionTier, detect pro-plus-* entitlements and map pro-plus into subscription selection ordering.
Subscribe & Subscription Details APIs
app/api/subscribe/route.ts, app/api/subscription-details/route.ts
Allow pro-plus-monthly-plan/pro-plus-yearly-plan in plan validation; derive pro-plus from product name/metadata when reporting subscription details.
UI: Pricing & Account
app/components/PricingDialog.tsx, app/components/AccountTab.tsx, app/components/SidebarUserNav.tsx
Add Pro+ plan card, features, button config, billing access and plan-title/badge changes; adjust upgrade visibility to include pro-plus.
Upgrade Hook & Types
app/hooks/useUpgrade.ts, lib/system-prompt.ts
Accept pro-plus in upgrade plan keys and subscription types; update system-prompt signatures to use SubscriptionTier.
Token, Rate-Limit & Limits Simplification
lib/token-utils.ts, lib/rate-limit/token-bucket.ts, convex/memories.ts, convex/notes.ts, convex/rateLimitStatus.ts
Add pro-plus to unions; simplify token limits to free=5000, paid=15000 for all paid tiers; add tier-aware upgrade hints in rate-limit messages.
Pricing Config
lib/pricing/features.ts
Add pro-plus pricing/header and export proPlusFeatures; adjust feature text arrays across tiers.
File Storage & Backend Entitlement Checks
convex/fileActions.ts, convex/fileStorage.ts, convex/__tests__/s3Actions.test.ts, lib/api/chat-handler.ts
Remove getFileLimit function and related mock; switch upload checks to explicit entitlements presence; adjust logging call formatting; update tests by removing the fileStorage mock.
E2E & Fixtures
e2e/fixtures/auth.ts
Change TestUser.tier to use SubscriptionTier.

Sequence Diagram(s)

sequenceDiagram
    participant User as Client (UI)
    participant Front as Frontend/API
    participant Auth as Auth Service
    participant Billing as Billing/Subcribe API
    participant Convex as Backend/Convex DB

    User->>Front: Click "Upgrade to Pro+"
    Front->>Auth: validate session
    Auth-->>Front: userId, entitlements
    Front->>Billing: POST /api/subscribe (pro-plus plan)
    Billing->>Convex: persist subscription / create payment session
    Convex-->>Billing: subscription created / metadata (pro-plus)
    Billing-->>Front: subscribe response / session URL
    Front->>User: redirect to payment
    Billing->>Convex: webhook -> update entitlements
    Convex-->>Front: entitlements updated
    Front->>Auth: refresh entitlements (entitlements route)
    Auth-->>Front: hasProPlus=true
    Front->>User: UI updates (Pro+ features, badges, token limits)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Poem

🐰 I nibble code and hop with cheer,
Pro+ arrived — a brighter gear,
New badge, new plans, and tokens clear,
I dig the carrots, upgrades near! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective: introducing a new 'pro-plus' subscription tier with monthly and yearly pricing options across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/pro-plus-plan

Comment @coderabbitai help to get the list of available commands and usage tips.

@rossmanko rossmanko changed the title Enhance subscription model by adding 'pro-plus' tier and updating rel… Introduced Pro+ subscription tier with monthly and yearly pricing options Jan 31, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@convex/memories.ts`:
- Around line 44-45: The comment above the tokenLimit assignment is misleading;
update it to clarify that MAX_TOKENS_PAID (the 100k context window in
token-utils.ts) refers to the model's overall context window while the local
variable tokenLimit (used in memories.ts) is the memory-specific budget (5000
for "free", 15000 for paid). Locate the tokenLimit assignment and replace the
comment with a concise note referencing MAX_TOKENS_PAID vs tokenLimit so future
readers understand the distinction between the model context window and the
memory token budget.

In `@convex/notes.ts`:
- Around line 181-182: The existing comment above the tokenLimit assignment is
misleading—replace it with a concise, accurate comment that explains this value
is the notes token budget (not the model's context/window) and reflect the
actual numbers used: free users get 5000 tokens and paid users get 15000 tokens;
do not reference a 100k context window here. Update the comment near the
tokenLimit variable (tokenLimit and args.subscription) to state that it’s the
notes token budget and list the free vs paid token amounts.
🧹 Nitpick comments (2)
lib/rate-limit/token-bucket.ts (1)

225-244: Consider extracting duplicate upgradeHint logic into a helper.

The upgradeHint construction logic is duplicated at lines 225-230 and 239-244. Both blocks are identical.

♻️ Proposed refactor to eliminate duplication
+const getUpgradeHint = (subscription: SubscriptionTier): string => {
+  if (subscription === "pro") {
+    return " or upgrade to Pro+ or Ultra for higher limits";
+  }
+  if (subscription === "pro-plus") {
+    return " or upgrade to Ultra for higher limits";
+  }
+  return "";
+};
+
 export const checkAgentRateLimit = async (
   // ... existing code ...

Then replace both occurrences:

-          const upgradeHint =
-            subscription === "pro"
-              ? " or upgrade to Pro+ or Ultra for higher limits"
-              : subscription === "pro-plus"
-                ? " or upgrade to Ultra for higher limits"
-                : "";
+          const upgradeHint = getUpgradeHint(subscription);
app/components/PricingDialog.tsx (1)

254-261: Minor UX inconsistency in button text for Pro+ users.

When a pro-plus user views the Pro plan card, the button shows "Pro" instead of a more descriptive text like "Downgrade unavailable" or keeping it consistent with other disabled states showing "Current Plan". This differs from the pattern where disabled buttons typically indicate why they're disabled.

Consider clarifying the button text for better UX.

💡 Suggested improvement
     } else if (user && subscription === "pro-plus") {
       // Pro+ users can't downgrade to Pro
       return {
-        text: "Pro",
+        text: "Included in Pro+",
         disabled: true,
         className: "opacity-50 cursor-not-allowed",
         variant: "secondary" as const,
       };

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@convex/memories.ts`:
- Around line 43-45: The token limit calculation uses args.subscription but that
field is optional and currently falls back to the paid limit when omitted;
update the logic that computes tokenLimit (the line setting tokenLimit based on
args.subscription) to treat a missing/undefined subscription as "free" (or
alternatively make the subscription argument required in the function
signature), e.g., normalize args.subscription before the ternary or explicitly
check for undefined and default to "free" so callers who omit args.subscription
get the 5000-token free limit; update any related type/interface for args if you
choose to make subscription required.

In `@convex/notes.ts`:
- Around line 180-182: The token-limit logic incorrectly treats an undefined
args.subscription as paid; update the calculation in the function that declares
tokenLimit (using args.subscription) so that undefined defaults to "free" rather
than premium—for example, explicitly check for "paid" (or coalesce
args.subscription to "free") before assigning tokenLimit (the variables to
update are tokenLimit and the use of args.subscription in convex/notes.ts) so
omitted subscriptions receive the free-tier limit.

When subscription parameter was not provided, the ternary expression
would evaluate to 15000 (paid tier) instead of 5000 (free tier).
Changed logic to explicitly check for undefined/missing subscription
and default to free tier limits.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rossmanko rossmanko merged commit d3d8836 into main Feb 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants