refactor(router): isolate API-key selection capture - #3897
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change extracts ChangesRouter selection capture
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change moves API-key selection snapshot capture into a shared leaf module while retaining the existing export and routing behavior. The covered compatibility and import-boundary changes present no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches🧪 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 |
|
✅ 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. |
리뷰 · 우선순위 52 / 80이 PR은 #3894를 닫습니다. 지금은 새 leaf는 src/providers/api-key-selection-capture.ts - 함수 본문이 이동만 되었고 로직 변경이 없습니다. entryId는 src/providers/api-key-selection.ts - 구현 삭제 후 src/router.ts - import 경로만 leaf로 바뀝니다. 순환의 한쪽 화살표가 끊깁니다. tests/providers/api-key-selection-capture.test.ts · dependency boundary - source를 읽어 런타임 import를 검사하므로 문서 문자열에 속지 않습니다. “전체 router 비순환”을 주장하지 않는 점이 솔직합니다. 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Summary
Closes #3894.
Move
captureProviderApiKeySelectionunchanged into a small provider module with type-only dependencies. The router imports this leaf directly, removing its direct dependency on the stateful selection module. The original module imports and re-exports the same function, preserving existing callers.Focused tests cover selected, missing, unmatched, and repeated pool references, immutable snapshots, compatibility export identity, and the runtime import boundary. Both test-layout registries and the runtime structure map include the new files. Other transitive router cycles are outside this change.
Verification
Windows, Bun 1.4.0; independent branch from
devat522ce5f8c8527d1e6c479a0090af14e390214bcb.bun test tests/providers/api-key-selection-capture.test.ts tests/adapters/key-failover.test.ts tests/providers/provider-key-store.test.ts tests/lab/core-lab-boundary.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts: 73 passed, 0 failed.bun run typecheck: passed.bun run privacy:scan: passed.bun install --frozen-lockfile: passed; lockfile unchanged.This draft does not attest the repository-wide test suite or maintainer approval. Plan and evidence:
devlog/_plan/260907_router_selection_capture/010_implementation.md.Checklist
Maintainer review remains pending; selection, resolution, and failover behavior are unchanged.
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests