Skip to content

statusline: warn when org spend limit is close#124

Open
NicolasGirardot wants to merge 2 commits into
mainfrom
feat/statusline-usage-limit-warning
Open

statusline: warn when org spend limit is close#124
NicolasGirardot wants to merge 2 commits into
mainfrom
feat/statusline-usage-limit-warning

Conversation

@NicolasGirardot

@NicolasGirardot NicolasGirardot commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Add ApiClient::get_usage_limit_status(org_id) calling GET /v1/organizations/:orgId/usage-limit-status (self-serve, resolves to the logged-in user via session — no admin role needed).
  • Poll it from the edgee statusline render renderer, 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.
  • Append a colored warning segment (⚠ NN% of $X used) to the statusline once usage crosses 80% (yellow), turning red at 100%+. No segment when unmetered, unknown, or below threshold.

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.
@NicolasGirardot NicolasGirardot requested a review from a team as a code owner July 1, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants