Skip to content

feat(devpass): premium cap as % of credits - #2835

Merged
steebchen merged 8 commits into
mainfrom
devpass-premium-weekly-percent
Jul 14, 2026
Merged

steebchen merged 8 commits into
mainfrom
devpass-premium-weekly-percent

Conversation

@steebchen

@steebchen steebchen commented Jun 26, 2026 •

Copy link
Copy Markdown
Member

What

Changes the DevPass premium-model weekly fair-use cap from hardcoded dollar amounts to a fraction of each tier's total monthly credit allowance:

Tier Premium weekly cap
Lite 12% of monthly credits
Pro 15% of monthly credits
Max 18% of monthly credits

Why

Previously the cap was a fixed 10 / 50 / 140 credits per tier, independent of the monthly allowance. That made the premium share of total credits drift and would silently change if DEV_PLAN_CREDITS_MULTIPLIER were adjusted.

Deriving the cap from getDevPlanCreditsLimit(tier) keeps the 12/15/18% ratio exact regardless of the multiplier. At the default 3× multiplier the new weekly caps are:

Tier Monthly credits Old weekly cap New weekly cap (% of monthly)
Lite $87 $10 $10.44 (12%)
Pro $237 $50 $35.55 (15%)
Max $537 $140 $96.66 (18%)

Changes

  • packages/shared/src/dev-plans.ts: replace DEV_PLAN_PREMIUM_WEEKLY_LIMITS (absolute) with DEV_PLAN_PREMIUM_WEEKLY_PERCENT (fraction); getDevPlanPremiumWeeklyLimit now returns monthlyLimit × percent.
  • packages/shared/src/index.ts: update re-export.
  • apps/docs/content/learn/model-categories.mdx: fair-use table now shows % of monthly credits.
  • apps/ui/src/content/changelog/2026-06-10-...md: updated to the percentage wording.

The cap is consumed only via getDevPlanPremiumWeeklyLimit → getRemainingPremiumWeeklyAllowance (gateway enforcement), so no call-site changes were needed. The reset cycle (rolling 7-day window) is unchanged.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Premium model weekly fair-use caps now scale with each DevPass plan’s monthly credits using tier-specific percentages (rolling 7-day cap).
  • Documentation

    • Updated model-category guide, FAQ, pricing page, and changelog copy to describe the weekly fair-use allowance as a percentage of monthly credits (Lite/Pro/Max) instead of fixed weekly amounts.

Make the DevPass premium weekly fair-use cap a fraction of each tier's
total monthly credit allowance instead of a hardcoded dollar amount:
10% (Lite), 15% (Pro), 20% (Max). Deriving from getDevPlanCreditsLimit
keeps the ratio exact regardless of DEV_PLAN_CREDITS_MULTIPLIER.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7227edc8-0062-4c53-ab68-1ecd5287583e

📥 Commits

Reviewing files that changed from the base of the PR and between 0e40ba8 and 77e33b5.

📒 Files selected for processing (3)
  • apps/code/src/app/pricing/page.tsx
  • apps/code/src/components/Faq.tsx
  • apps/code/src/components/PricingPlans.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/code/src/components/Faq.tsx
  • apps/code/src/components/PricingPlans.tsx

Walkthrough

Shared dev plan premium weekly caps now derive from tier percentages of monthly credits, and pricing copy, documentation, FAQ content, and the changelog describe that cap format.

Changes

Dev plan premium weekly cap update

Layer / File(s) Summary
Percent-based weekly cap
packages/shared/src/dev-plans.ts, packages/shared/src/index.ts
Replaces hardcoded weekly limits with DEV_PLAN_PREMIUM_WEEKLY_PERCENT, computes weekly limits from monthly credits, and updates the shared re-export.
Pricing and FAQ display
apps/code/src/components/PricingPlans.tsx, apps/code/src/app/pricing/page.tsx, apps/code/src/components/Faq.tsx
Updates premium-model fair-use displays to show percentage-of-monthly-credits values and revises Pro plan wording.
Cap wording updates
apps/docs/content/learn/model-categories.mdx, apps/ui/src/content/changelog/2026-06-10-chat-plans-service-tiers-product-roundup.md
Updates documentation and changelog text to describe tier-specific percentage-based weekly caps.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: smakosh

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: DevPass premium caps are now expressed as a percentage of credits.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devpass-premium-weekly-percent

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.

❤️ Share

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ad9d633ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


export function getDevPlanPremiumWeeklyLimit(tier: DevPlanTier): number {
return DEV_PLAN_PREMIUM_WEEKLY_LIMITS[tier];
return getDevPlanCreditsLimit(tier) * DEV_PLAN_PREMIUM_WEEKLY_PERCENT[tier];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update public premium-cap documentation

Since this now enforces the cap as getDevPlanCreditsLimit(tier) * percent, the default limits become 8.70/35.55/107.40 credits, but the current published docs still list 10/50/140 credits in apps/docs/content/learn/model-categories.mdx lines 37-41. Users on Lite/Pro/Max can be blocked much earlier than the documented allowance, so update the docs or derive the displayed caps from the shared helper in the same change.

Useful? React with 👍 / 👎.

Update model-categories docs and the 2026-06-10 changelog entry to
reflect the premium weekly fair-use cap now being 10%/15%/20% of monthly
credits (Lite/Pro/Max) instead of fixed 10/50/140 credit amounts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f58de27f8c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


export function getDevPlanPremiumWeeklyLimit(tier: DevPlanTier): number {
return DEV_PLAN_PREMIUM_WEEKLY_LIMITS[tier];
return getDevPlanCreditsLimit(tier) * DEV_PLAN_PREMIUM_WEEKLY_PERCENT[tier];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the pricing-page cap copy

Fresh evidence after the earlier docs comment: this calculation now makes the default caps $8.70 / $35.55 / $107.40, but the public DevPass pricing page still advertises the old $10 / $50 / $140 allowance in apps/code/src/app/pricing/page.tsx:302-307 (confirmed with repo-wide rg for the old values). Users can choose a plan from that page expecting a higher premium allowance than the gateway now enforces, so update or derive that copy from the shared helper as part of this change.

Useful? React with 👍 / 👎.

huangyingting pushed a commit to repomesh/llmgateway that referenced this pull request Jun 28, 2026
## Context

The `e2e` job on theopenco#2835 failed on six provider/model mappings. I
reproduced each failure locally against the live providers (gateway on
:4001, real keys) to find the root cause. The CI "33s / retry x5" is
just retry backoff over **fast** errors, so the local errors match what
CI hit.

## Findings

| Model | Reproduced error | Root cause | Action |
|---|---|---|---|
| `moonshot/kimi-k2-thinking` | `404 resource_not_found` | Moonshot
retired the kimi-k2-thinking line (live `/v1/models` only lists
k2.5/k2.6/k2.7); BytePlus Ark dropped every snapshot too | **Fixed
here** |
| `sakana/fugu-ultra` | `403 Forbidden` (HTML, `via: 1.1 google`) |
Google edge/WAF blocks **all** requests incl. unauthenticated `/` —
geo/WAF block from test infra, not a mapping/URL bug | Infra (see below)
|
| `azure-ai-foundry/grok-4-1-fast-reasoning` | `404 DeploymentNotFound`
| Foundry resource has no grok deployment (404 for every name) | Infra
(unprovisioned) |
| `azure/gpt-oss-120b` | `404 DeploymentNotFound` | Azure resource has
**zero** deployments (`data: []`) | Infra (unprovisioned) |
| `together-ai/gpt-oss-120b` | `503 Service Unavailable` | Provider-side
outage (single/multi-turn passed in CI; the tool-call test caught the
blip) | Transient |
| `aws-bedrock/claude-sonnet-4-6` | **Works now** (valid tool_call) | CI
failure was a ~32s cold-start timeout, not an error | Transient flake |

## Change

Only the Moonshot failure is a real, code-fixable mapping bug. This PR
deactivates the retired `kimi-k2-thinking` mappings:

- `moonshot/kimi-k2-thinking` → `deactivatedAt`
- `bytedance/kimi-k2-thinking` (`-251104`) → `deactivatedAt`
- `moonshot/kimi-k2-thinking-turbo` → `deactivatedAt`

The model keeps its `alibaba` provider (`test: skip`, active until its
own `2026-07-08` deactivation), so it is not orphaned.

The other five are **not mapping bugs**: two are unprovisioned Azure
resources (deployments need creating), one is a geo/WAF block on
Sakana's endpoint, and two are transient provider hiccups. None are
fixable by editing model definitions — flagging for an infra decision
(provision the Azure deployments; confirm whether Sakana is reachable
from gateway infra, else mark `test: "skip"`).

## Verification

- `turbo run build` — 17/17 ✓
- `providers.spec` / `model-metadata.spec` / `compliance.spec` — 36/36 ✓
- Live re-test: moonshot/bytedance kimi-k2-thinking all 404; mappings
now excluded from e2e

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Updated Moonshot model availability by deactivating select offerings.
* Added a deactivation timestamp for the kimi-k2-thinking family
providers (including kimi-k2-thinking-251104 and kimi-k2-thinking-turbo)
as of 2026-06-28.
  * Ensures affected options clearly reflect their unavailability date.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 9, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

steebchen and others added 2 commits July 9, 2026 20:15
Merge origin/main and adapt apps/code PricingPlans (new consumer on main)
to the percentage-based premium weekly cap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Update the remaining user-facing DevPass premium fair-use mentions from
the old $10/$50/$140 weekly amounts to 12%/15%/18% of monthly credits:
the pricing page footnote and both the FAQ data string and its hardcoded
accordion list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@steebchen
steebchen enabled auto-merge July 14, 2026 22:34
steebchen and others added 2 commits July 14, 2026 23:37
…y-percent

# Conflicts:
#	apps/code/src/app/pricing/page.tsx
#	apps/code/src/components/Faq.tsx
#	apps/code/src/components/PricingPlans.tsx
Re-apply percentage-based premium fair-use (12/15/18%) onto main's
rewritten pricing page, FAQ, and plan cards after merge; fix the now-
inaccurate '5x the frontier fair-use of Lite' Pro bullet.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@steebchen
steebchen added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit cc70404 Jul 14, 2026
17 checks passed
@steebchen
steebchen deleted the devpass-premium-weekly-percent branch July 14, 2026 23:03
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