fix(cli): preserve absent OAuth plan fields - #4996
Conversation
An absent plan key means the proxy predates tier reporting while plan: null means it checked and found no tier. The CLI projection collapsed absent to null, erasing the distinction. Forward the key only when the response owns it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe OAuth account projection now preserves the distinction between an absent ChangesOAuth plan field fidelity
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The OAuth account JSON projection preserves the intended distinction between unavailable tier data and an explicit no-tier result. No actionable merge risk remains. 🚥 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 |
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
리뷰 · 우선순위 72 / 80이 PR은 고침은 한 줄 계약입니다. types.ts/config.ts 스플릿과 무관하고, 같은 주제의 열린 중복 PR은 보이지 않습니다. src/cli/account-api.ts (fetchOAuthRows plan 투영) - 메인테이너의 판단이 필요한 지점
너의 추천 머지하세요. 작은 정정이고 테스트가 계약을 잠급니다. tip에 올린 뒤 Cross-platform/로컬 게이트만 확인하면 됩니다. 라벨은 바꾸지 마세요. 이 댓글은 grok-bot이 작성했습니다 |
|
Merging with one macOS red that is a known The only failure at this head is That failure is deterministic and fast, so it is distinguishable from the timeout and cancellation pattern tracked in #4956; I am treating fast assertions as real results and timeouts as the known defect, rather than waving both through. |
Summary
The
ocx account list --jsonOAuth projection collapsed two different wire states into one: an absentplankey (proxies that predate tier reporting) and an explicitplan: null(the proxy checked and found no tier) both came out asplan: null. Downstream version-detection and automation read the absent key as the old-proxy signal, so synthesizingnullfor it reports the wrong thing.fetchOAuthRowsinsrc/cli/account-api.tsnow forwardsplanonly when the response object actually owns the property (Object.hasOwn), so absent stays absent whilenulland reported tiers pass through verbatim — matching the row type's own contract (plan?: string | null, [Feature]: expose the Anthropic account subscription tier (plan) like the OpenAI provider does #3777).tests/cli/cli-dto-fidelity.test.ts— the file that already covers "the CLI discarded fields the API already returned" — becausetests/cli/cli-account.test.tssits exactly at its file-size-ratchet cap and cannot grow.Verification
Exact head:
e5c3e3419781a97c5ce95cd6ed150c9bb4cef8e9(treee606e4ad524de0430d103d62d75bfc7ecdb6df95), based on devad9eab393b1125ca7bdfa3e83ed4fa0e0b0475e9.bun x tsc --noEmit— clean.bun run structure:check— passed.bun run privacy:scan— passed.bun scripts/file-size-ratchet.ts— passed.bun test tests/cli/cli-dto-fidelity.test.ts— 22/22 pass.bun test tests/cli/cli-account.test.ts— 153/153 pass.plan: null), passes with the fix.Remaining gates
macos controllane is subject to the known 30-minute dispatch cap tracked in [Bug]: macOS control is cancelled near its 30-minute limit in full dispatch CI #4905.Review readiness checklist
Summary by CodeRabbit
Bug Fixes
null.Tests