feat(console): add idempotent Go quota repair - #45553
Open
opencode-agent[bot] wants to merge 1 commit into
Open
opencode-agent[bot] wants to merge 1 commit into
opencode-agent[bot] wants to merge 1 commit into
Conversation
6 tasks
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
Add an authenticated support endpoint for one exact reduction of a Go subscriber's current monthly consumed quota, without changing weekly/rolling usage, billing, or the subscription.
This repairs existing state after a confirmed counter defect. It does not replace the separate inference-accounting reset-boundary fix.
Deployment
Agent-side approval tool: https://github.com/anomalyco/experiments/pull/502.
Requires the additive
20260827122435_go_quota_repairmigration, then the Console endpoint deployment. No production migration or mutation has been performed. The corresponding OpenCode Agent tool will require an exact human-approved correction and validate this endpoint's structured receipt.Verification
TMPDIR=/tmp/opencode GO_QUOTA_REPAIR_TEST_PORT=<isolated-local-mysql-port> bun test test/go-quota-repair.test.ts test/date.test.ts test/subscription.test.tsin Console core: 69 passed, including real local MySQL transaction, concurrency, replay, stale-state, identity, expiry, and rollback coverage.bun typecheckin Console core and Console app: passed.git diff --check: passed.PlanetScale and live Stripe execution have not been tested; the production action remains approval-gated.
Requested by: @MrMushrooooom (Jack via Slack)