Improve Kiro credits and account display - #933
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the Kiro provider surfaces by parsing richer account/plan/credits metadata from the local kiro-cli output and presenting it in the menu card, provider menu, and settings UI, while keeping Kiro-specific identity details provider-scoped.
Changes:
- Extend Kiro probing to capture account email/auth method, normalized plan display name, bonus credits, overages status, manage URL, and best-effort
/contextusage. - Add Kiro-specific menu bar display mode settings (credits/percent variants) and update menu bar rendering accordingly.
- Update menu card/provider detail surfaces to show Kiro plan/auth/overages and improved credits/bonus formatting; add/adjust tests.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/CodexBarTests/StatusItemBalanceDisplayTests.swift | Adds tests for Kiro-specific menu bar display modes and managed-plan fallback behavior. |
| Tests/CodexBarTests/MenuCardModelTests.swift | Adds a Kiro menu card model test validating plan/auth/credits/bonus/overages display. |
| Tests/CodexBarTests/KiroStatusProbeTests.swift | Expands probe tests for display plan name, new CLI formats, context usage parsing, and whoami parsing. |
| Sources/CodexBarCore/UsageFetcher.swift | Persists Kiro-specific usage details (kiroUsage) inside UsageSnapshot. |
| Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift | Implements richer Kiro parsing (plan normalization, bonus credits, overages/manage URL, context usage, whoami parsing) and provider-scoped usage details. |
| Sources/CodexBar/StatusItemController+Animation.swift | Adds Kiro-specific menu bar display rendering and Kiro credit formatting helper. |
| Sources/CodexBar/SettingsStoreState.swift | Adds defaults-state storage for the new Kiro menu bar display mode. |
| Sources/CodexBar/SettingsStore+MenuObservation.swift | Ensures menu updates observe kiroMenuBarDisplayMode. |
| Sources/CodexBar/SettingsStore+Defaults.swift | Adds UserDefaults persistence/getters for kiroMenuBarDisplayMode. |
| Sources/CodexBar/SettingsStore.swift | Introduces KiroMenuBarDisplayMode enum and loads default value from UserDefaults. |
| Sources/CodexBar/Providers/Kiro/KiroProviderImplementation.swift | Adds a Kiro-specific settings picker for menu bar value display. |
| Sources/CodexBar/PreferencesProviderDetailView.swift | Shows an “Auth” row/label for Kiro in provider detail. |
| Sources/CodexBar/MenuDescriptor.swift | Adds Kiro plan/auth/overages secondary lines in the provider menu descriptor. |
| Sources/CodexBar/MenuCardView+Kiro.swift | New helper extension for Kiro plan/notes/credit formatting in the menu card model. |
| Sources/CodexBar/MenuCardView+Costs.swift | Refactors credits/cost/token helpers out of MenuCardView.swift into a dedicated file. |
| Sources/CodexBar/MenuCardView.swift | Wires Kiro-specific plan/notes/credits+bonus detail text into the menu card model; removes duplicated cost helper implementations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9854b21fe1
ℹ️ 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".
Fixes Claude Enterprise/organization web accounts by tolerating null session-window usage and exposing an optional organization ID field for Claude token accounts. Local verification: - swift test --filter 'ClaudeWebEnterpriseUsageTests|ProvidersPaneCoverageTests|ClaudeUsageTests' - make check Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Piotr Durlej <pdurlej@users.noreply.github.com>
Co-authored-by: zhulijin1991 <zhulijin1991@users.noreply.github.com>
Co-authored-by: Bryan Font <bfont@me.com>
Fixes steipete#944. Refs steipete#946. Co-authored-by: Jakub Hašek <kubahasek@users.noreply.github.com>
Co-authored-by: Radek Sienkiewicz <mail@velvetshark.com>
* Add Antigravity account switching * Force Antigravity account chooser * Persist Antigravity selected account updates
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5aa81135eb
ℹ️ 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".
| loginMethod: self.planName) | ||
| accountEmail: self.accountEmail, | ||
| accountOrganization: nil, | ||
| loginMethod: self.authMethod) |
There was a problem hiding this comment.
Keep Kiro plan in identity login field
Setting ProviderIdentitySnapshot.loginMethod to authMethod for Kiro changes the meaning of that field from plan to auth provider, but downstream renderers still treat loginMethod as the plan for non-Kilo providers (for example, Sources/CodexBarCLI/CLIRenderer.swift labels it as Plan). With this change, Kiro CLI output will show values like Plan: Google and lose the actual subscription tier unless every consumer is updated in lockstep.
Useful? React with 👍 / 👎.
| if let estimatedMatch = text.range( | ||
| of: #"Estimated Usage\s*\|[^\n|]*\|\s*([A-Z][A-Z0-9 ]+)"#, | ||
| options: .regularExpression) | ||
| { |
There was a problem hiding this comment.
Mark Estimated Usage format as new-format parsing
The Estimated Usage | ... | ... parser branch extracts a plan name but never sets matchedNewFormat = true. Later, the managed-plan fallback requires matchedNewFormat to be true before tolerating missing credit metrics, so CLI 2.x managed outputs that omit usage bars can incorrectly throw parseError instead of returning a managed snapshot.
Useful? React with 👍 / 👎.
* Improve Kiro credits UX * Add provider changelog links * Fix changelog menu test * feat: gate provider changelog links behind setting * Address Kiro review feedback * Polish Kiro credit detail styling * fix: repair stale managed Codex account removal * fix: handle Claude enterprise web accounts (steipete#941) Fixes Claude Enterprise/organization web accounts by tolerating null session-window usage and exposing an optional organization ID field for Claude token accounts. Local verification: - swift test --filter 'ClaudeWebEnterpriseUsageTests|ProvidersPaneCoverageTests|ClaudeUsageTests' - make check Co-authored-by: Claude <noreply@anthropic.com> * docs: update changelog for Claude enterprise fix * fix: handle quota and usage edge cases * Rebalance Kimi provider icon (steipete#912) * Add zh-Hans translations for Claude peak hour labels (steipete#921) * docs: update changelog for recent contributor fixes * Add Tahoe menu bar visibility guidance Co-authored-by: Piotr Durlej <pdurlej@users.noreply.github.com> * Coalesce historical pace reset buckets Co-authored-by: zhulijin1991 <zhulijin1991@users.noreply.github.com> * Add Codex priority cost pricing Co-authored-by: Bryan Font <bfont@me.com> * fix: parse Claude web spend limits * fix: refresh Gemini credentials without access token * refactor: split Claude web extra usage helpers * fix: defer account switcher menu rebuilds Fixes steipete#944. Refs steipete#946. Co-authored-by: Jakub Hašek <kubahasek@users.noreply.github.com> * docs: fix changelog spacing * fix: handle unavailable Codex limits gracefully * docs: update unreleased changelog * fix: repair update and account menu paths Co-authored-by: Radek Sienkiewicz <mail@velvetshark.com> * fix: handle account-scoped usage and menu login bugs * Add Antigravity account switching (steipete#937) * Add Antigravity account switching * Force Antigravity account chooser * Persist Antigravity selected account updates * docs: add Antigravity account switching changelog --------- Co-authored-by: thiagocaltoe <thiago12_fera@hotmail.com> Co-authored-by: Peter Steinberger <steipete@gmail.com> Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Giuseppe Bisemi <giuseppe.bisemi@gmail.com> Co-authored-by: HaiTao Wu <whtis@users.noreply.github.com> Co-authored-by: Piotr Durlej <pdurlej@users.noreply.github.com> Co-authored-by: zhulijin1991 <167979819+zhulijin1991@users.noreply.github.com> Co-authored-by: zhulijin1991 <zhulijin1991@users.noreply.github.com> Co-authored-by: iam-brain <94809115+iam-brain@users.noreply.github.com> Co-authored-by: Bryan Font <bfont@me.com> Co-authored-by: Jakub Hašek <kubahasek@users.noreply.github.com> Co-authored-by: Radek Sienkiewicz <mail@velvetshark.com> Co-authored-by: Larry Hao(郝卓远) <107194248+hhh2210@users.noreply.github.com>
Summary
Notes
/contextremains best-effort in the probe, but context window details are not shown in the menu card UI.Validation
swift test --filter KiroStatusProbeTests --filter KiroMenuCardModelTests --filter StatusItemBalanceDisplayTestsmake check./Scripts/compile_and_run.shswift testran 2,350 tests and only hit a transientOpenAIDashboardNavigationDelegateTestsfailure; rerunningswift test --filter OpenAIDashboardNavigationDelegateTestspassed.Closes #934