Commit Graph

11 Commits

Author SHA1 Message Date
Gaurav Ghosh 6836f0e1b2 feat: implement G1 AI credits overage flow with billing telemetry
Adds end-to-end support for Google One AI credits in quota exhaustion flows:

- New billing module (packages/core/src/billing/) with credit balance
  checking, overage strategy management, and G1 URL construction
- OverageMenuDialog and EmptyWalletDialog UI components for quota
  exhaustion with credit purchase options
- Credits flow handler extracted to creditsFlowHandler.ts with overage
  menu, empty wallet, and auto-use-credits logic
- Server-side credit tracking: enabledCreditTypes on requests,
  consumed/remaining credits from streaming responses
- Billing telemetry events (overage menu shown, option selected, credits
  used, credit purchase click, API key updated)
- OpenTelemetry metrics for overage option and credit purchase counters
- Credit balance display in /stats command with refresh support
- Settings: general.overageStrategy (ask/always/never) for credit usage
- Error handling: INSUFFICIENT_G1_CREDITS_BALANCE as terminal error
  regardless of domain field presence
- Persistent info message after
2026-02-25 05:08:13 -08:00
Sehoon Shon 723f269df6 fix(core): treat 503 Service Unavailable as retryable quota error (#19642) 2026-02-20 19:51:53 +00:00
Gaurav 07bd89399d fix: remove obsolete CloudCode PerDay quota and 120s terminal threshold (#17236) 2026-01-23 01:33:32 +00:00
Gaurav 3b626e7c61 Add interactive ValidationDialog for handling 403 VALIDATION_REQUIRED errors. (#16231) 2026-01-21 00:23:01 +00:00
Sehoon Shon 07e597de40 Exponential back-off retries for retryable error without a specified … (#15684) 2025-12-29 22:23:23 +00:00
Sehoon Shon 9e6914d641 Handle all 429 as retryableQuotaError (#15288) 2025-12-18 23:25:42 +00:00
Adam Weidman 22e6af414a feat: attempt more error parsing (#14899) 2025-12-10 19:14:07 +00:00
Gaurav f51d74586c refactor: parse string for retryInfo (#12586) 2025-11-05 16:42:58 +00:00
Gaurav ee92db7533 fix: handle request retries and model fallback correctly (#11624) 2025-10-24 18:09:06 +00:00
Gaurav 996c9f5955 Revert "fix: handle request retries and model fallback correctly" (#11164) 2025-10-14 23:30:59 +00:00
Gaurav 319f43fa23 fix: handle request retries and model fallback correctly (#9407) 2025-10-03 20:24:50 +00:00