From 4aa0a7c195376aa90e9948e71bc24748c805da17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=B3=A5=E8=B1=86?= <1243352777@qq.com> Date: Tue, 28 Apr 2026 10:18:56 +0800 Subject: [PATCH] fix(error-classifier): add insufficient balance to billing patterns 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 #15586. --- agent/error_classifier.py | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/error_classifier.py b/agent/error_classifier.py index 0780bde90..511ab353c 100644 --- a/agent/error_classifier.py +++ b/agent/error_classifier.py @@ -91,6 +91,7 @@ class ClassifiedError: _BILLING_PATTERNS = [ "insufficient credits", "insufficient_quota", + "insufficient balance", "credit balance", "credits have been exhausted", "top up your credits",