Repository navigation
Handle prepaid billing errors with the reviewed Platform SDK - #6
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: 7 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour. 📝 WalkthroughWalkthroughThe CLI now presents payment-required errors with exit code 4 and preserved metadata. Tests cover fractional balances, HTTP 402 responses, retry behavior, and tier-change retrieval. The README documents prepaid billing and tier-quote workflows. ChangesPrepaid billing behavior
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant APICommand
participant PolymorfaSDK
participant presentError
APICommand->>PolymorfaSDK: send API request
PolymorfaSDK-->>APICommand: return HTTP 402 entitlement error
APICommand->>presentError: present payment-required error
presentError-->>APICommand: return category and exit code 4
Merge Risk: ⚪ Minimal · up to The prepaid funding error handling, tests, and documentation changes have no identified merge-blocking issue. 🚥 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 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use Comment |
382afc7 to
1a81f94
Compare
Insufficient prepaid funding now produces the
payment_requiredcategory, preserves the API error code and request ID, and exits with code 4 without retrying the operation. The README documents fractional credit quantities and the explicit quote → review → confirm flow for tier changes.Rebased onto CLI dev
41547aa(after #7). The SDK pin is unchanged from dev:github:polymorfa/sdks#08452992a32a392de5fc3d0fa3954ba6addd7f32. That SDK revision (sdks#175) already includes the reviewed billing quote/confirmation andPolymorfaPaymentRequiredErrorchanges from the now-closed sdks#94, so this PR no longer changes the dependency. Its API pin is1600403db9dcf7996dbbb882375b1165859829d3.Verification
Clean
npm ci, thennpm run verify: formatting, lint, typecheck, 260 tests in 30 files, build and package dry run all pass.npm run audit:prodfound 0 vulnerabilities. That audit was rerun separately because the first attempt hit a transient registry DNS failure.Surface impact
1600403.src/errors/present.ts), the exit code, tests and README.Summary by CodeRabbit
New Features
Documentation
--input.