Skip to content

feat: Build batch health probe and account all-time usage totals - #783

Draft
felixszeto wants to merge 1 commit into
chenyme:mainfrom
felixszeto:feat/batch-health-probe-and-account-totals
Draft

feat: Build batch health probe and account all-time usage totals#783
felixszeto wants to merge 1 commit into
chenyme:mainfrom
felixszeto:feat/batch-health-probe-and-account-totals

Conversation

@felixszeto

@felixszeto felixszeto commented Jul 25, 2026

Copy link
Copy Markdown

Summary

  • Add an admin batch health probe for Grok Build accounts (minimal Responses hi request) with configurable probeConcurrency.
  • On probe success, sync Billing and clear local waiting-reset (ClearQuotaRecovery) so accounts re-enter routing immediately.
  • Classify probe failures: credential/permission → reauth; quota exhaustion → waiting-reset; rate-limit/5xx → short cooldown; invalid model → no account penalty.
  • Persist per-account all-time usage totals (total_tokens / total_cost_ticks / total_requests) incremented atomically on request-audit writes, with one-time backfill from request_audits.
  • Probe traffic is intentionally not audited, so it does not inflate usage totals.

Test plan

  • Unit tests for relational audit usage increment + backfill guard
  • Admin UI: Build accounts toolbar shows Health probe left of quota sync
  • Probe success on waiting-reset account clears waiting-reset and refreshes quota display
  • Probe with invalid public model name (Build/...) does not cool healthy accounts after namespace strip
  • After a normal chat request, account list shows updated all-time totals
  • Existing request audits remain intact after migration

Add an admin batch health probe for Grok Build accounts and persist
per-account lifetime token/cost/request counters from request audits.
Successful probes clear waiting-reset state without counting probe traffic
toward usage totals.
@chenyme
chenyme marked this pull request as draft July 28, 2026 06:45
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This pull request has had no activity for 7 days. It will be closed in 7 days if there is no further activity.

@github-actions github-actions Bot added the stale label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant