fix(cloud): status reads the balance as cents, not micro-dollars (BE-16748) - #926
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe cloud billing path now treats ChangesBilling unit correction
Suggested reviewers: Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Cloud status now displays cent-valued balances at the correct dollar amount, with matching documentation and regression coverage. The change is ready to merge. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Swarmhost agentic reviewThe detailed evaluation is available to employees in the internal Slack review thread. Updated by Swarmhost's agentic review process. |
james00012
left a comment
There was a problem hiding this comment.
Approving. Reads as: reads the balance fields as cents, which the server sends under the micros names. Head 54addba, judged as comfy-cli's owner.
Optional
- Correctness: credits can land 1 to 3 below the platform page
comfy_cli/cloud/billing.py:127. The server sends fractional cents; the CLI truncates them, while the platform rounds. - Tests: the new test derives expected credits from the code's own formula
tests/comfy_cli/cloud/test_status_command.py:174. The literal 733999 would pin it. - Scope: three comments still call the balance micro-dollars
comfy_cli/cloud/billing.py:100. They contradict the new comment, the confusion behind this bug. - Modularity: the balance variable and helper still say micros while holding cents
comfy_cli/cloud/command.py:452. The next reader will take it for a unit bug.
Clean: Verbosity, Resilience, Access, Reachability, Contract, Rollout.
Native review: 8 findings, folded into the list above.
Checked: Ingest and billing-api on cloud main send cents in all four fields. Main's code fails 8 of the new status tests. The red GPU job fails on main too.
Bots: CodeRabbit and Swarmhost raised nothing; cursor-review did not run.
…16748) The balance endpoint sends cents in fields named *_micros. Dividing them by 1,000,000 showed every balance and credit figure 10,000 times too small. The field names stay as the wire contract; only the unit changes.
54addba to
b3af4fa
Compare
comfy cloud statusshowed every balance 10,000 times too small. The balance endpoint sends cents in fields named*_micros; the CLI divided them by 1,000,000. It now divides by 100. The field names stay, since they are the wire contract, and the JSON schema description says the unit is cents.Tests: the status fixtures are restated in cents, and a new test checks a realistic balance (347,867 -> $3,478.67).
BE-16748