Repository navigation
fix: stop brev create from retrying every instance type after billing. - #541
Merged
Merged
Conversation
stephahart
approved these changes
Dec 2, 2026
stephahart
deleted the
BREV-13503/stop-create-retries-on-billing-errors
branch
December 2, 2026 01:23
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
When a create fails, brev create moves on to the next instance type in its list. Billing rejections were treated like any other failure, so one rejection turned into a failed create for every type in the list, a few seconds apart. The API now tags these rejections with an error code, and brev create now acts on it:
Details
AllInstanceTypesResponse.HourlyCost. Types without a price are skipped, and if the rejected type itself has no price, the command stops. With the default cheapest-first list, it usually stops after one attempt.--count N, a billing rejection stops the remaining attempts for that type.brev createnow stops in these cases and exits with the reason:organization '<org>' is out of credits. Add credits and try againOrganization spending limit exceeded. Contact support to increase your limit.(the API's own message, which the web console also shows)organization '<org>' doesn't have enough credits to run <type> for 30 minutes. Add credits or choose a cheaper instance type