Surface Devin overage balance as extra usage#1893
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 10:35 PM ET / 02:35 UTC. Summary Reproducibility: not applicable. as a feature PR rather than a bug report. Source inspection, tests, and screenshot proof show the new Devin balance path instead of a failing current-main behavior. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this ProviderCostSnapshot-based implementation if maintainers accept the existing optional credits/extra-usage setting as the consent boundary for Devin balances, with full exact-head validation before merge. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature PR rather than a bug report. Source inspection, tests, and screenshot proof show the new Devin balance path instead of a failing current-main behavior. Is this the best way to solve the issue? Yes, conditionally: reusing ProviderCostSnapshot and the existing optional extra-usage visibility setting is the narrowest maintainable implementation if maintainers accept that privacy boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5c608332e37c. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
Parses Devin's overage_balance (remaining prepaid USD credit) into a ProviderCostSnapshot with period 'Extra usage balance', mirroring the Factory prepaid-balance path across the menu card, widget, and CLI. - Core: DevinUsageSnapshot parses root-level overage_balance (and overage_balance_cents fallback) into providerCost with limit 0 - Menu: show the balance row for Devin under the Factory-parity branch; stop hiding optional provider cost for Devin - Widget: add ProviderChoice.devin to the extra-usage display enum - CLI: append an 'Extra usage: $X' line for Devin (provider-guarded so Factory's same period string stays silent) - Tests: cover dollars, cents, and absence
9d7cfbe to
0fcda7c
Compare
|
Follow-up: added a Re-verified on the final tree (commit
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d7cfbe91c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
When a Devin account has no primary rate window (weekly-only / hide_daily_quota path), appendPrimaryLines previously saw providerCost with period 'Extra usage balance' and emitted a bogus 'Cost: <balance> / 0.0' line before the dedicated Extra usage line. Guard the generic fallback so Devin extra-usage balances render only via appendDevinOverageBalanceLine. Factory keeps the fallback since it always sets primary alongside providerCost. Adds a CLI test: Devin snapshot with primary == nil + overage balance asserts the Extra usage line is present and no generic Cost: line appears.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99d275aa49
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Add providerCost field to WidgetSnapshot.ProviderEntry and populate it in UsageStore.makeWidgetEntry so the overage balance flows from the snapshot into widget data. Render an 'Extra usage · Balance: $X' row in small/medium/large and switcher widget views, gated on period == 'Extra usage balance' so unrelated provider costs (Claude spend, Bedrock budgets, etc.) are not mislabeled. Extract WidgetBalanceFormatter.extraUsageBalance as a testable internal helper returning a WidgetBalanceLine title+value, with the views wrapping it in ValueLine. Tests: assert the formatter renders the balance for a Devin entry with period 'Extra usage balance', returns nil for a non-balance providerCost (Claude monthly spend), and that providerCost survives JSON round-trip through ProviderEntry.
# Conflicts: # Tests/CodexBarTests/CodexBarWidgetProviderTests.swift
|
Landed in 37e4225 from exact head f3bbc4c after 10/10 checks passed. |
Summary
Surfaces Devin's remaining prepaid extra-usage balance across the app menu, CLI, and widgets. The implementation reuses CodexBar's balance-only cost model while keeping provider data isolated and respecting the existing optional credits/extra-usage visibility setting.
Improvements made during review
Changes
overage_balance, withoverage_balance_centsas a fallback.ProviderCostSnapshot.Extra usagein Devin CLI output.Current diff: 13 files, +406/-20.
Verification
make check: passed; SwiftFormat clean and SwiftLint reported 0 violations.DevinUsageFetcherTests,CodexBarWidgetProviderTests,CLISnapshotTests,UsageStoreWidgetSnapshotTests, and the main-mergeUsageFormatterTests.Extra usage: $48.00.make test: all 47 shards passed; the subprocess suite's built-in retry passed cleanly.f3bbc4caafter maintainer workflow approval.Notes