Repository navigation
fix(anthropic): record account 403 rotations as oauth-account-403, not a 429 - #7185
vadymhimself wants to merge 1 commit into
Conversation
|
@coderabbitai review |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
✅ Action performedReview finished.
|
|
✅ Deterministic PR hygiene checks passed. |
c196b1b to
4546764
Compare
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
An Anthropic OAuth rotation triggered by a classified account-entitlement 403 was recorded as `anthropic-oauth-429` on the main dispatch, the pre-output continuation retry and the web-search/image sidecars. Metrics and failure attribution therefore counted credential/entitlement denials as rate limits (cause `rate-limit`), so a spent quota and a refused account were indistinguishable. Record the existing `oauth-account-403` kind (cause `credential-rejected`) for a 403, as the native Messages path already does. 401 stays `oauth-401`, 429 stays `anthropic-oauth-429`; rotation behaviour is unchanged. Co-Authored-By: Claude Code <noreply@anthropic.com>
4546764 to
c03c7fa
Compare
|
Being carried into #7224 with your authorship preserved; this PR will be closed when the bundle lands. |
…evidence fixes (#7191, #7204, #7187, #7209, #7175, #7185, #7193, #7197, #7198) (#7224) Carried from #7191, #7204, #7187, #7209, #7175, #7185, #7193, #7197, #7198 (one commit per source PR, original author preserved). Security review follow-up: the Anthropic 402 combo cooldown now validates the sending credential's ownership before cooling an account. Remote validation (hosted GitHub Actions unreliable; local tests not run by maintainer rule): union candidate codex/prr-integ-8 = dev c03eafd + #7224 + #7223 + #7225 + #7217 + #6454 + #6594 plus a Gentle Shell import-cycle fix (integ-9 e1f289c: typecheck + full suite on mini (Windows) and lidge (Linux), compared with the same host's dev runs) and a test-only Windows path-escaping fix for the reasoning-retention routing test (integ-10 0d4cba7, tree a2b309a: that file re-run on both hosts). Co-authored-by: Vadym O <bolein95@gmail.com>
Summary
anthropic-oauth-429on four routed paths: main adapter dispatch (adapter-dispatch.ts), the pre-output empty-completion continuation retry (adapter-continuation.ts), and the web-search / image sidecars (sidecar-execution.ts, which the loops'on429hook passes through unchanged).causeForRecoveryKind("anthropic-oauth-429")israte-limit, soopencodex_recoveries_total,opencodex_request_failures_totaland request-log failure attribution counted a credential/entitlement denial as a rate limit. An operator could not tell an account whose quota was spent (429) from one whose subscription/org was refused (403).oauth-account-403kind (causecredential-rejected) for a 403. The native Messages path (messages-native.ts) already does this. 401 staysoauth-401and 429 staysanthropic-oauth-429.noteRoutedAttemptSend), andoauth-account-403is already in the analytics cooldown-triggering set alongsideanthropic-oauth-429.structure/providers/anthropic-account-pool.mdstates the recorded kind.Verification
dev(0b13396), before the fix: the newtests/adapters/anthropic/anthropic-quota-dispatch.test.tscase%s account 403 rotation records oauth-account-403failed for main, search, image and continuation, with recorded kinds["anthropic-oauth-429", "anthropic-oauth-429"](continuation also hadempty-completion).bun scripts/test.ts tests/adapters/anthropic/ tests/web-search/web-search-recovery-kind.test.ts tests/images/loop.test.ts tests/lib/failure-stage-model.test.ts tests/usage/request-outcome-agreement.test.ts tests/claude-integration/messages-native-oauth.test.ts tests/oauth/generic-oauth-failover.test.ts: 1512 pass, 0 fail.bun run typecheck: passes.bun run structure:check: passes.bun run privacy:scan: passes.bun run test:changed(againstupstream/dev): 14563 pass, 1 fail across 575 files. The one failure,tests/cli/cli-connect-readiness.test.ts›connected-client runtime probe scope > a rejected preferred runtime falls back without rewriting the saved selection, also fails on a cleandevworktree (2 of 2 runs there) and is unrelated to this change.bun run testlocally.test:changedcovers the import graph of the three changed source files, and CI covers the rest.Checklist
🤖 Generated with Claude Code
Summary by CodeRabbit
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.