Repository navigation
fix(errors): read 400 quota only from the provider fields, not echoed words (AGE-2650) - #26
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
qa-sec (Mars) at head My L1 from #25, closed in all three places.
LOW, not blocking:
A new push voids this GREEN. |
|
Follow-up commit f5ef1e6 (AGE-2689, closing Mars's two non-blocking notes before this ships):
Tests:
Fixture provenance: we have no recorded samples for the spend-limit, Volcengine or echo bodies. Those tests reuse the recorded extra-usage envelope with only the message swapped, or build the body from the docs table, and each test cites its source. The real refusal fits under the 500-character cut with about 140 characters to spare. |
|
qa-sec (Mars) re-review at head
A new push voids this GREEN. |
|
qa-sec (Mars) re-stamp at head
|
✅ READY
Hygiene✅ Deterministic PR hygiene checks passed. |
4321ddc to
2b2b94a
Compare
|
independent-qa (Mars): GREEN at Re-stamp after the conflict rebuild. No new code to read:
My earlier allowed-path and refusal-path findings carry over unchanged. Merge when CI is green at this head. A new push voids this GREEN. |
f4303eb
into
release/2.65.0-vadymhimself.15
Why (AGE-2650, Mars L1 on #25)
classifyErrormatched quota and rate words anywhere in a 400's text. Providers copy client values into a 400. For example, an Anthropic validation error quotes a tool id liketoolu_insufficient_quota. So one crafted request could be read as a spent account or a rate limit. That made the combo hop and cool a whole provider for 10 minutes. The same weakness was in two more places:inferHttpStatusFromAdapterMessage:Provider error 400: … rate limit …was read as 429.isRateLimitOrQuotaFailureMessage: an echoed 400 could mark a subagent model unhealthy.What
src/lib/anthropic-extra-usage.tsholds the anchored envelope and phrase matcher from [WRONG BRANCH] fix(pool): rotate Anthropic pool accounts on out-of-extra-usage 400 #25, so the pool andclassifyErrorshare one copy. Pool behaviour is unchanged.classifyError, HTTP 400 only: quota only if one of these is true.error.codeorerror.typefield isinsufficient_quota. This covers OpenAI/Codex and our own re-wrapped errors, followed at most 3 levels deep.error.messagestarts with the extra-usage wording.inferHttpStatusFromAdapterMessageandisRateLimitOrQuotaFailureMessage: an exactProvider error <NNN>prefix states the status, so it wins over keyword guessing.Stacked on #25: base is
gauge/pool-rotate-extra-usage-400. Retarget to the release line after #25 merges.Eval added/updated:
tests/routing/router-combo-400-quota-echo.test.tshas 16 cases.toolu_insufficient_quota, "out of extra usage", "rate limit", "too many requests" and "usage limit" in a 400 cause no combo cooldown, no 429 and no unhealthy subagent model.fixtures/external/anthropic/extra-usage-thirdparty-400.txt. We have no recorded Anthropic validation 400. So the echo cases reuse that recorded envelope and swap onlyerror.messagefor the echoing text. The test says so.Tested
QA: Mars (security).
🤖 Generated with Claude Code