Skip to content

[codex] Clarify Anthropic extra-usage exhaustion errors - #6498

Closed
HiddenPuppy wants to merge 1 commit into
NousResearch:mainfrom
HiddenPuppy:codex/fix-anthropic-extra-usage-guidance
Closed

[codex] Clarify Anthropic extra-usage exhaustion errors#6498
HiddenPuppy wants to merge 1 commit into
NousResearch:mainfrom
HiddenPuppy:codex/fix-anthropic-extra-usage-guidance

Conversation

@HiddenPuppy

Copy link
Copy Markdown
Contributor

Summary

  • detect Anthropic's "You're out of extra usage" API error separately from generic non-retryable 400s
  • surface clearer guidance that this is a third-party/Hermes API usage limit, not something restart or re-login usually fixes
  • return actionable next steps to CLI and gateway users, and cover the behavior with a regression test

Root Cause

Hermes treated Anthropic's extra-usage exhaustion response like any other non-retryable client error. The request failure itself was correct, but the messaging was too generic, which made a usage-limit state look like a broken login or Hermes bug.

Validation

  • ran pytest -n 0 tests/run_agent/test_anthropic_error_handling.py
  • result: 9 passed in 90.30s
  • ran pytest -n 0 tests/run_agent/test_long_context_tier_429.py
  • result: 15 passed in 0.14s

Fixes #6475

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/anthropic Anthropic native Messages API labels Apr 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #11736, #13170 — same Anthropic 'out of extra usage' classification issue.

1 similar comment
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #11736, #13170 — same Anthropic 'out of extra usage' classification issue.

@OutThisLife

Copy link
Copy Markdown
Collaborator

Thanks @HiddenPuppy — closing as implemented on main.

The core of this PR — detecting Anthropic's "out of extra usage" 400 as a billing/entitlement condition (instead of an opaque non-retryable error) and surfacing actionable guidance — has since landed via #56128 (merged 2026-07-01):

  • agent/error_classifier.py now lists "out of extra usage" in _BILLING_PATTERNS, so the 400 classifies as FailoverReason.billing (rotate + fallback) rather than format_error.
  • agent/conversation_loop.py _billing_or_entitlement_message has a dedicated Anthropic branch that points at https://claude.ai/settings/usage, notes the billing-cycle reset, and offers the /model … --provider … switch — the same actionable next-steps this PR added, via the canonical CLI + gateway guidance path.

One thing #56128 does not cover, and this PR didn't either: the sibling phrasing "Third-party apps now draw from your extra usage / enable extra usage" (a distinct 400 body). That's addressed in #49379, which is staying open.

Appreciate the report and the fix — the behavior you were after is now the default.

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 P2 Medium — degraded but workaround exists provider/anthropic Anthropic native Messages API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anthropic Claude subscription auth returns 'You're out of extra usage' in Hermes even after restart/re-login

4 participants