Skip to content

fix(providers): surface clear arrearage warning to user on quota/billing errors (#3006) - #4048

Merged
Re-bin merged 1 commit into
HKUDS:mainfrom
04cb:fix/arrearage-user-warning-3006
May 29, 2026
Merged

Re-bin merged 1 commit into
HKUDS:mainfrom
04cb:fix/arrearage-user-warning-3006

Conversation

@04cb

@04cb 04cb commented May 29, 2026

Copy link
Copy Markdown
Contributor

Closes #3006

providers/base: add LLMProvider.is_arrearage_response() to detect arrearage / quota / billing errors (HTTP 402, billing tokens, text markers), reusing the existing _NON_RETRYABLE_429_* sets.

agent/runner: on an arrearage error, reply with a clear user-facing message instead of the raw provider dump; other errors unchanged.

@chengyongru

Copy link
Copy Markdown
Collaborator

LGTM

❯ uv run nanobot agent
🐈 Interactive mode (kimi-k2.6) (preset: kimi) — type exit or Ctrl+C to quit

You: hi

🐈 nanobot
The AI provider rejected the request because the API key is out of quota or the account is
in arrears. Please top up / check the billing status of your API key and try again.

You:

@Re-bin
Re-bin merged commit 9d3fe7c into HKUDS:main May 29, 2026
4 checks passed
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.

no warning when api-key in arrearage

3 participants