Files
Moltbot/src
Glucksberg d4c560853c fix(errors): show clear billing error instead of cryptic API response (#8391)
* fix(errors): return clear billing error message instead of cryptic raw error (#8136)

When an LLM API provider returns a credit/billing-related error (HTTP 402,
insufficient credits, low balance, etc.), OpenClaw now shows a clear,
actionable message instead of passing through the raw/cryptic error text:

  ⚠️ API provider returned a billing error — your API key has run out of
  credits or has an insufficient balance. Check your provider's billing
  dashboard and top up or switch to a different API key.

Changes:
- formatAssistantErrorText: detect billing errors via isBillingErrorMessage()
  and return a user-friendly message (placed before the generic HTTP/JSON
  error fallthrough)
- sanitizeUserFacingText: same billing detection for the sanitization path
- pi-embedded-runner/run.ts: add billingFailure detection in the profile
  exhaustion fallback, so the FailoverError message is billing-specific
- Added 3 new tests for credit balance, HTTP 402, and insufficient credits

* fix: extract billing error message to shared constant
2026-02-05 13:58:43 -08:00
..
2026-01-30 03:16:21 +01:00
2026-02-04 10:37:14 -05:00
2026-02-05 12:33:59 -08:00
2026-02-02 04:58:32 -08:00
2026-02-02 23:45:05 -08:00
2026-01-30 03:16:21 +01:00
2026-02-04 19:09:52 -05:00
2026-02-02 23:45:05 -08:00
2026-02-05 19:51:00 +09:00
2026-01-14 15:02:19 +00:00
2026-02-03 06:10:19 +00:00