statusline: warn when org spend limit is close#124
Open
NicolasGirardot wants to merge 2 commits into
Open
Conversation
Polls GET /v1/organizations/:orgId/usage-limit-status (self-serve, resolves to the logged-in user) and appends a colored warning segment to the statusline once usage crosses 80%, so users see the cap coming before they hit it. Cached on disk with the same TTL as session stats; silent no-op on missing auth, network failure, or no limit configured.
SachaMorard
approved these changes
Jul 9, 2026
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
ApiClient::get_usage_limit_status(org_id)callingGET /v1/organizations/:orgId/usage-limit-status(self-serve, resolves to the logged-in user via session — no admin role needed).edgee statusline renderrenderer, cached on disk with the same 8s TTL as session stats. Org id / user token come from the local credentials file, no new env var.⚠ NN% of $X used) to the statusline once usage crosses 80% (yellow), turning red at 100%+. No segment when unmetered, unknown, or below threshold.