Repository navigation
Fix/stripe invoice webhooks - #135
Merged
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b57421f. Configure here.
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.

Description
Provide a brief summary of the changes and the motivation behind them.
Related Issues
Link any related issues below (use
Closes #123to auto-close on merge).Type of Change
Contributor Checklist
make lintpasses with no errorsmake test-unitpassesScreenshots / Logs
If applicable, add screenshots or log output to help reviewers.
Note
High Risk
Changes core Stripe overage charging, invoice webhook ordering, and period closure—errors could double-charge, miss revenue, or close the wrong billing period.
Overview
Introduces durable billing reports so usage overages are reserved in Postgres (
billing_reports) with frozen Stripe payloads, then delivered asynchronously with retries—replacing the previous pattern of creatingInvoiceItems inline and advancing watermarks immediately.Stripe renewal flow is tightened: overages target the invoice’s ending period (from
period_start/period_end), draft invoices get last-chance capture, finalized invoices roll charges to carryover, andinvoice.paidstages closure markers without rebilling the wrong month. Subscription period advances are forward-only so delayed webhooks cannot rewind billing. A Celery dispatcher recovers pending reports and checks recently closed periods for late Redis counters.Also bumps release to v0.7.0, default judge model to
vertex_ai/gemini-3.5-flash-lite, upgrades LiteLLM, expands judge picker models, and makes batch/single eval run names optional in the dashboard (field moved below Model).Deploy: run migration
fd38fefe55a8before rollout; avoid running legacy and new overage reporters in parallel.Reviewed by Cursor Bugbot for commit 4d881e7. Bugbot is set up for automated code reviews on this repo. Configure here.