fix(usage): reject persisted rows without provider labels - #2413
Conversation
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughUsage-log parsing now validates persisted rows before normalization. Rows must contain string ChangesUsage row validation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This focused change rejects malformed persisted usage rows while preserving valid legacy normalization, with no actionable merge-blocking risk remaining after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
리뷰 · 우선순위 52 / 80설명: 이 PR 은 저장된 사용량 줄에서 요청 아이디와 제공자가 둘 다 글자가 아니면 그 줄만 건너뛴다. 지금 CURRENT src/usage/log.ts 라인 1153 - 지금 HEAD 동기 읽기는 요청 아이디만 본다. 제공자가 없어도 normalizeUsageEntry 로 간다 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Summary
requestIdandproviderare strings, at both the synchronous and cooperative reader boundaries./api/usageinto aread_failedempty summary.Verification
bun test --isolate tests/usage-log.test.ts tests/usage-summary.test.ts tests/usage-provider-label.test.ts— 83 passed, 0 failed, 353 assertions.bun run typecheck— passed.bun run privacy:scan— passed.git diff --check— passed.35f0b88cd9486df788318e1f54a6ff72e7a2be6c, based directly ondevat4f41a8e936141af7ee828e335da314b9dc1ef761.Checklist
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