Check X credit balance before telling users to buy - #265
Open
vaulpannx wants to merge 4 commits into
Open
Conversation
Agents now fetch GET /2/usage/credits on connect and suggest work that fits the user's dollar balance. Co-authored-by: Cursor <cursoragent@cursor.com>
Fetch get_usage_credits before any on-connect copy, and only mention console.x.com when the balance is ~$0 or a job would not fit. Co-authored-by: Cursor <cursoragent@cursor.com>
Error 3 no longer fights the "nothing else" rule or the paid By budget rows. Cache {credits} as $0 and re-fetch after a top-up.
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 79ca810. Configure here.
Error 3 is only for blocked billed requests. A successful get_usage_credits of ~$0 keeps capabilities, states $0.00, and offers free lookups. Co-authored-by: Cursor <cursoragent@cursor.com>
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
get_usage_creditsbefore any user-facing X text on connect.Test plan
get_usage_creditshas returned.Made with Cursor