fix: bug-PR merge train batch 7 (multi-account OAuth 429 budget with a per-request ceiling) - #5924
Conversation
…udget The #5916 allowance funded three sends for every eligible account and raised the hop limit to roster size minus one, with no fixed ceiling: a large roster let one request make 3 x N upstream sends and push a 429 storm across the pool. GENERIC_OAUTH_MAX_ACCOUNTS_PER_REQUEST (6) now clamps the roster snapshot in request-transport.ts and again inside expandInferenceOAuthSendBudget, so the default ingress ceiling is 18 sends whatever the roster size. Explicit caller budgets are unchanged. New case: eight accounts make exactly 18 sends over the first six (24 without the clamp). Docs and structure state the cap; the batch plan is added.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (22)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change adds a six-account cap for Generic OAuth failover and derives a request-specific rotation limit from the eligible roster. It expands eligible ingress send budgets, updates recovery send accounting, and uses the shared transient retry limit for Google HTTP requests. Tests and documentation describe the revised limits. ChangesGeneric OAuth failover and send budgets
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant ResponsesTransport
participant InferenceSendBudget
participant GoogleHTTPAdapter
participant GenericOAuthFailover
ResponsesTransport->>InferenceSendBudget: Expand unused ingress budget for capped account count
ResponsesTransport->>GoogleHTTPAdapter: Dispatch request with send budget
GoogleHTTPAdapter->>GoogleHTTPAdapter: Retry transient responses within attempt limit
GoogleHTTPAdapter->>GenericOAuthFailover: Return terminal 429 for account rotation
GenericOAuthFailover->>GoogleHTTPAdapter: Dispatch with next eligible account
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The capped OAuth retry behavior has no identified merge-blocking issue after normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to A rate-limited request can now retry across more accounts and make up to 18 upstream sends by default. The new cap prevents that allowance from growing with a larger account pool, but repeated requests could still put pressure on shared accounts. No exploit is verified. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 61.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 14 files. (8 skipped: 8 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
리뷰 · 우선순위 60 / 80구글 안티그래비티처럼 로그인 계정이 여러 개인 OAuth에서, 429가 나면 다른 계정으로 바꿔 다시 보냅니다. #5916의 수정과, 계정이 많아도 한 요청이 무한정 두드리지 못하게 막는 상한을 한 묶음으로 가져왔습니다. 이슈 #5880을 닫습니다. 베이스는 예전에는 요청 하나의 기본 예산이 4번이었습니다. 첫 계정이 429를 세 번 재시도하면 예산이 끝나서, 뒤에 있는 계정은 시도하지 못했습니다. 이 묶음은 보내기 전에 쓸 수 있는 계정 수를 고정합니다. 계정이 2개 이상이면 계정마다 3번을 줍니다. 한 요청이 세는 계정은 최대 6개입니다. 계정이 100개여도 기본 예산은 18번에서 멈춥니다. #5916만 있으면 계정 수 × 3이라 상한이 없었습니다. 계정이 하나면 예전처럼 기본 3번, 합계 4번입니다. 호출하는 쪽이 횟수를 직접 정한 경우와 콤보는 이 늘리기를 타지 않습니다. 같은 제공자 안에서 계정만 바꿀 때, 기록용 이름 때문에 다른 주소로 간 것처럼 세지 않습니다. 계획 문서는 #5497과 #5539를 이번에 가져오지 않고, #5831은 주인이 정할 일이라고 적습니다. 가져온 코드의 작성자는 codingbooo이고, 커밋과 본문에
메인테이너의 판단이 필요한 지점 기본 상한 18번이 맞는지 정하면 됩니다. 주소가 계정마다 다른 풀도 6계정까지 가야 한다면 주소 전환 한도를 같이 올려야 합니다. #5916은 아직 열려 있습니다. 이 PR이 그 수정을 이미 품고 있어서, 둘 다 머지하면 같은 고침이 두 번 들어갑니다. 너의 추천 위생 검사부터 푸세요. 계획 문서를 고쳐 봇이 #5497, #5539, #5831을 가져온 PR로 읽지 않게 하면 됩니다. codingbooo 이름은 이미 있습니다. 주의 상자 890번째 줄은 818번째 줄과 같게 고치세요. 그다음 이 PR을 머지하고 #5916은 닫으면 됩니다. #5497, #5539, #5831은 이 묶음에 넣지 마세요. 이 댓글은 grok-bot이 작성했습니다 |
✅ READY
Hygiene✅ Deterministic PR hygiene checks passed. |
|
Security review record for this batch (OAuth retry budget, MAINTAINERS.md security-boundary rule).
|
Summary
Batch 7 of the bug-PR merge train: one carried fix plus a security follow-up. The carried commit keeps its original author and a
Co-authored-bytrailer.Integration commit
32be95be75: an independent security review of #5916 found that the allowance and hop limit both scaled with the enrolled roster and had no ceiling. With 100 accounts, one request could make 300 upstream sends and spread a 429 storm across the pool.GENERIC_OAUTH_MAX_ACCOUNTS_PER_REQUEST = 6now clamps the roster snapshot inrequest-transport.ts, and the clamp is repeated insideexpandInferenceOAuthSendBudget, so the default ingress ceiling is 18 sends whatever the roster size (it was 4 before #5916). Explicit caller budgets are unchanged. A new case enrolls eight accounts and expects exactly 18 sends over the first six accounts; without the clamp it sees 24. The docs andstructure/transports/state the cap.The batch also adds the merge-train roadmap and the batch plan under
devlog/_plan/260926_bug_train_6/, which record a decision for every open bug-labelled pull request.Verification
bun x tsc --noEmit: exit 0.bun run structure:checkandbun run privacy:scan: pass.Retry-After429, key failover e2e, Kiro 401 replay, combo failover e2e): 272 pass, 0 fail.test 4/4batch timeout intests/cli/*(every file passed alone) was rerun.Checklist
docs-siteproviders reference,structure/transports/).Closes #5880
Co-authored-by: codingbo cnsdbo@163.com