fix: omit inferred credit usage above plan allowance - #236
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.
Shadow auto-approve: would auto-approve. Fixes negative inferred credit usage by omitting that line when the remaining balance exceeds the plan allowance. The focused rendering tests cover above, equal, and below allowance cases while preserving existing valid displays.
Re-trigger cubic
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.
When the remaining credit balance exceeds the plan allowance,
firecrawl credit-usagesubtracts the balance from the allowance and reports negative usage and a negative percentage.Keep showing the remaining balance and plan allowance, and omit the inferred usage line in that case. The API response does not provide enough information to calculate actual usage from those two values. Balances at or below the allowance retain the existing display; JSON output is unchanged.
Validation: TypeScript build, formatting check, and the credit-usage test file pass (17 tests). A focused rendering regression covers balances above, equal to, and below the allowance.
Summary by cubic
Fixes
firecrawl credit-usagereporting negative usage when the remaining credit balance exceeds the plan allowance. The command now omits the inferred used-credits line in that case, since the API response doesn't provide enough data to compute actual usage; balances at or below the allowance keep the existing display, and JSON output is unchanged.Written for commit 65af5e3. Summary will update on new commits.