Repository navigation
fix(combos): hop past Anthropic's extra-usage refusal - #8588
vadymhimself wants to merge 2 commits into
Conversation
Anthropic refuses an OAuth turn that bills against an empty extra-usage
balance with HTTP 400 invalid_request_error ("You're out of extra usage"
or "Third-party apps now draw from your extra usage, not your plan
limits"). comboFailureDecision treated it as a terminal invalid request,
so a combo ended the turn instead of reaching its next tier.
Recognize the exact wording under the credit-balance evidence bar
(invalid_request_error envelope, or exact prose with that structured code)
and grant a target-scoped hop. Quoted, coded and other-typed variants stay
terminal.
Carried from the vadymhimself fork (e987656, 79faf06).
Co-Authored-By: Claude Code <noreply@anthropic.com>
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. Hygiene✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Summary
invalid_request_error. The message is either "You're out of extra usage. Add more at claude.ai/settings/usage and keep going." or the newer "Third-party apps now draw from your extra usage, not your plan limits. Add more at claude.ai/settings/usage and keep going." Public reports: [BUG] CLI completely blocked by "out of extra usage" error despite Max 20x plan at only 10% usage anthropics/claude-code#45020, Anthropic OAuth (Claude Pro/Max subscription) hits "You're out of extra usage" on every real request — routes through pay-per-token endpoint instead of subscription quota NousResearch/hermes-agent#65564 and #79760, and fix: Claude OAuth proxied requests rejected as third-party extra usage (all harnesses) decolua/9router#4353.comboFailureDecisionclassifies that 400 as a terminal invalid request. As a result, a combo such as Claude OAuth → GPT ends the turn instead of moving to its next tier.isAnthropicExtraUsageFailureinsrc/providers/anthropic-billing-refusal.ts. It uses the same evidence bar as the existing credit-balance refusal: aninvalid_request_errorenvelope with the exact wording, or the exact prose together with that structured code. The check runs before the generic invalid-request stop and grants a target-scoped hop.context_length_exceeded), other-typed (api_error) and uncoded bare-prose variants all stay terminal.classifyError. Here it is reworked to follow upstream's exact-envelope pattern (fix(router,combos): hop and cool provider on upstream account quota exhaustion #7625).Verification
All commands used the pinned Bun 1.4.4 with an isolated
HOME.bun test tests/routing/router-anthropic-billing-failover.test.ts: 3 pass, 0 fail. With thesrc/change reverted, the new test fails (2 pass, 1 fail).bun scripts/test.ts --changed=upstream/dev: 43601 pass, 6 fail. All six fail identically without this change:codex-composed-acceptance×2 (fails the same way on the base)connected-client runtime probe scopelink-ocx-child-e2e×2retained sync and serve-optionsbun run typecheck,bun run structure:checkandbun run privacy:scanall pass.structure/runtime.mdto match.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
🤖 Generated with Claude Code
Summary by CodeRabbit