{{ message }}
Repository navigation
improvement(billing): replace daily refresh credits with weekly refresh - #7113
Merged
Merged
Conversation
Contributor
Greptile SummaryThe PR replaces daily refresh credits with fixed weekly allowances, using seven-day usage-ledger buckets anchored to the billing-period start.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported scope-dependent display mismatch is corrected because both the subscription display and enforcement path now scale by seats only for organization-scoped billing.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/settings/components/billing/billing.tsx | Displays the resolved weekly allowance and now applies seat scaling only in organization billing scope, matching enforcement. |
| apps/sim/lib/billing/credits/weekly-refresh.ts | Implements seven-day ledger bucketing, per-window allowance caps, period clamping, and organization seat scaling. |
| apps/sim/lib/billing/plan-helpers.ts | Centralizes plan-to-weekly-refresh resolution while excluding free and enterprise plans. |
| apps/sim/lib/billing/core/usage.ts | Replaces daily-refresh deductions with weekly-refresh deductions across resolved and current-period usage. |
| apps/sim/lib/billing/core/billing.ts | Applies weekly-refresh deductions consistently to personal and organization overage calculations. |
| apps/sim/lib/billing/calculations/usage-monitor.ts | Uses weekly allowances in both personal and pooled organization usage enforcement. |
| packages/db/schema.ts | Updates schema documentation for the weekly-refresh billing-period interpretation without changing the persisted schema contract. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
P[Subscription plan] --> R[getPlanWeeklyRefreshDollars]
R --> S{Organization scoped?}
S -- Yes --> M[Multiply allowance by seats]
S -- No --> O[Use one-seat allowance]
M --> B[Bucket ledger usage into 7-day windows]
O --> B
B --> D[Deduct consumed refresh from usage]
D --> E[Enforcement and overage calculation]
R --> U[Subscription display]
S --> U
Reviews (2): Last reviewed commit: "fix(billing): scope weekly refresh row s..." | Re-trigger Greptile
icecrasher321
force-pushed
the
staging-v73
branch
from
August 26, 2026 19:11
bd97b3e to
9a0bc96
Compare
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 22 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
Author
|
@greptile |
Contributor
Author
|
@cubic-dev-ai review |
Contributor
5 of 6 tasks
TheodoreSpeaks
added a commit
that referenced
this pull request
Aug 28, 2026
The free plan's 1,000 credits are a one-time grant, not a monthly allowance. Free accounts have no subscription, so usage resolves against the open default billing window (epoch to year 9999) and is never reset: cycle-close skips free plans outright, and weekly refresh is paid-only. - Pricing cards, in-app upgrade table, and pricing JSON-LD now read "Included credits" with per-plan cadence: 1,000 one-time for Free, 6,000/month and 25,000/month for Pro and Max - Weekly refresh values carry /week so both rows are self-describing - Comparison free-tier fact no longer claims a monthly grant - Library articles say one-time credits for the free plan - Docs FAQ paid-plan credits corrected to 6,000 and 25,000 - dify-alternatives also described a 50/200-credit daily refresh, which was replaced by the weekly refresh in #7113
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
DAILY_REFRESH_RATEwith fixed per-tierweeklyRefreshCreditsand agetPlanWeeklyRefreshDollarsresolver shared by the billing math and every display surfaceType of Change
Testing
Checklist