Skip to content

Improve Kiro credits and account display - #933

Merged
steipete merged 28 commits into
steipete:mainfrom
solnikhil:codex/improve-kiro-credits-ux
May 14, 2026
Merged

Improve Kiro credits and account display#933
steipete merged 28 commits into
steipete:mainfrom
solnikhil:codex/improve-kiro-credits-ux

Conversation

@solnikhil

@solnikhil solnikhil commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • parse Kiro account email, auth method, plan, credits, bonus credits, overages, manage URL, reset dates, and best-effort context usage from the local CLI
  • show Kiro account/auth, normalized plan names, credit balances, bonus balances, and overage state in the provider menu and settings surfaces
  • add a Kiro-specific menu bar value picker for Automatic, Hidden, Credits left, Percent left, Credits + percent, and Used / total
  • keep Kiro plan details out of shared provider identity fields so auth method and account metadata stay provider-scoped

Notes

  • /context remains best-effort in the probe, but context window details are not shown in the menu card UI.
  • This keeps v1 CLI-only and does not add web/API probing.

Validation

  • swift test --filter KiroStatusProbeTests --filter KiroMenuCardModelTests --filter StatusItemBalanceDisplayTests
  • make check
  • ./Scripts/compile_and_run.sh
  • swift test ran 2,350 tests and only hit a transient OpenAIDashboardNavigationDelegateTests failure; rerunning swift test --filter OpenAIDashboardNavigationDelegateTests passed.

Closes #934

Copilot AI review requested due to automatic review settings May 13, 2026 07:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /context usage.
  • 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.

Comment thread Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift
Comment thread Sources/CodexBar/StatusItemController+Animation.swift Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Sources/CodexBarCore/Providers/Kiro/KiroStatusProbe.swift
solnikhil and others added 22 commits May 13, 2026 13:11
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
@steipete
steipete merged commit 66b8277 into steipete:main May 14, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +690 to +693
if let estimatedMatch = text.range(
of: #"Estimated Usage\s*\|[^\n|]*\|\s*([A-Z][A-Z0-9 ]+)"#,
options: .regularExpression)
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

LeoLin990405 pushed a commit to LeoLin990405/CodexBar that referenced this pull request Aug 6, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Kiro credits and account visibility