fix(providers): rebase key failover on persisted state (carry of #3529) - #3546
Conversation
Co-authored-by: yansigit <44089734+yansigit@users.noreply.github.com>
|
Warning Review limit reachedNext included review available in 12 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (7)
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 |
|
✅ Deterministic PR hygiene checks passed. |
리뷰 · 우선순위 74 / 80설명 이 PR은 API 키 풀에서 429가 났을 때, “어느 설정 스냅샷을 믿고 키를 돌릴지”를 고치는 유지자 캐리입니다. 원본은 기여자 PR 지금 고치는 방법은 두 갈래입니다. 첫째, 회귀 테스트는 wp1 Stack A merge train의 독립 LAND_AS_IS 레이어로 보이며, 형제 캐리 라인 - 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Ingwannu
left a comment
There was a problem hiding this comment.
Security-boundary review completed at exact head 7c922afaf4ade3b4d0083282cfd82a3799922ee3.
The retry now mutates the schema-valid committed provider row under mutatePersistedConfig, publishes cooldown state only after a successful/unchanged persistence decision, adopts a concurrent healthy rotation instead of rotating twice, and never recreates a missing or invalid config. rotateProviderTransportOn429 routes that committed row again, so deleted fields stay deleted while registry metadata is restored; only the explicit runtime-only fetch executor and generated OpenCode session-affinity header survive. The regression matrix covers removed keys/fields, concurrent pool edits, stale handlers, unavailable persistence, and the affected response/chat/combo paths. The structure document now states the same precedence.
Cross-platform CI run 33926640849 completed successfully on this exact SHA, including all Linux shards, both macOS shards, keyring/npm jobs, gates, and storage/API-usage checks. No unresolved review thread remains. Approved.
|
Maintainer admin merge (ruleset bypass recorded per MAINTAINERS.md): carry of #3529, exact-head CI green on 7c922af (24 pass / 2 skipped / 0 fail; core-lab-boundary green; the docs blocker from the CHANGES_REQUESTED review on 8b0327f is addressed by the author's 92b4eda). wp1 of the 260905 open-work closeout. |
Summary
rotateKeyOn429rebuilt the routed provider from the in-memory config, so a 429 rotation could resurrect a key the user had already removed from disk. This carry rebuilds from the committed provider row insrc/providers/key-failover.ts, reapplies registry metadata, and preserves only the runtimefetchplus generated OpenCode session affinity. The author's final commit92b4eda26updates the JSDoc andstructure/04_transports-and-sidecars.mdthat the CHANGES_REQUESTED review on8b0327f4basked for.core-lab-boundarystays green with the newsrc/routerimport.Supersedes #3529 (maintainer carry: original is a contributor draft whose readiness checklist would reset on any push; carry = PR head merged with
origin/dev).Stack (wp1 merge train, independent layers — each targets
dev):Unit:
devlog/_plan/260905_open_work_closeout/(010, 011).Verification
bun run typecheck— exit 0 on the carry head.bun test tests/adapters/key-failover.test.ts tests/lab/core-lab-boundary.test.ts— 33 pass / 0 fail;bun test tests/adapters/openai/openai-chat-native-policy.test.ts tests/providers/openrouter-provider-routing.test.ts tests/server/terminal-guard-server.test.ts tests/server/server-combo-failover-e2e.test.ts— 145 pass / 0 fail (three failover tests are RED on dev before the change).Checklist
devCo-authored-bytrailerCo-authored-by: yansigit 44089734+yansigit@users.noreply.github.com