Skip to content

fix(error-classifier): add insufficient balance to billing patterns - #16772

Closed
zons-zhaozhy wants to merge 1 commit into
NousResearch:mainfrom
zons-zhaozhy:fix/insufficient-balance-billing-pattern
Closed

zons-zhaozhy wants to merge 1 commit into
NousResearch:mainfrom
zons-zhaozhy:fix/insufficient-balance-billing-pattern

Conversation

@zons-zhaozhy

Copy link
Copy Markdown

Summary

DeepSeek API returns HTTP 400 with "Insufficient Balance" when account funds are depleted. This pattern was missing from _BILLING_PATTERNS, causing the error to be misclassified instead of triggering billing exhaustion handling (fallback to alternate provider, skip retry).

Change

  • Added "insufficient balance" to _BILLING_PATTERNS in agent/error_classifier.py (line 93)

Context

Suggested by @teknium1 in review of #15586:

insufficient balance billing pattern — this string is not yet in _BILLING_PATTERNS (agent/error_classifier.py line 90). A focused one-line PR or issue to add it would be welcome.

DeepSeek API returns HTTP 400 with 'Insufficient Balance' message when
account funds are depleted. This pattern was not in _BILLING_PATTERNS,
causing the error to be misclassified instead of triggering billing
exhaustion handling (e.g., fallback to alternate provider).

Suggested by teknium1 in PR review of NousResearch#15586.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/deepseek DeepSeek API labels Apr 28, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

Merged via #16976 — your commit was cherry-picked onto current main with authorship preserved (rebase-merge). Thanks @zons-zhaozhy!

@zons-zhaozhy
zons-zhaozhy deleted the fix/insufficient-balance-billing-pattern branch May 4, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have provider/deepseek DeepSeek API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants