Repository navigation
feat(usage): show Kiro subscription credits in the status bar - #26390
w-felipe360 wants to merge 20 commits into
Conversation
formatRateLimitResetLabel returned null for human-readable resetDescription values such as "Thu" or "2:30 PM" because only ISO dates were recognized. Return non-date descriptions unchanged so the status bar keeps a valid reset label.
execFile cannot launch configured .cmd/.bat paths directly on Windows. Route the Kiro usage command through getSpawnArgsForWindows like the other usage fetchers; native binaries keep the direct execFile path.
The Antigravity coverage landed upstream after this branch last rebased. Its test file predates the Kiro provider, so the shared resetRateLimitProviderMocks harness now fails on the unmocked fetchKiroRateLimits import. Declare the same vi.mock the other service test files use.
Upstream now feeds a ticking `now` into ProviderRateLimitWindowSection; `formatRateLimitResetLabel` gains an optional `now` (default Date.now()) so the label keeps re-rendering on the clock without inventing reset times.
Signed-off-by: guanbear <123guan@gmail.com>
# Conflicts: # src/main/rate-limits/rate-limit-service-test-harness.ts # src/main/rate-limits/service-account-target-selection.test.ts # src/main/rate-limits/service-inactive-account-previews.test.ts # src/main/rate-limits/service-live-claude-usage.test.ts # src/main/rate-limits/service-minimax-usage.test.ts # src/main/rate-limits/service-refresh-orchestration.test.ts # src/main/rate-limits/service-window-activation.test.ts # src/main/rate-limits/service/service-full-cycle-application.ts # src/main/rate-limits/service/service-full-cycle-preparation.ts # src/main/rate-limits/service/service-polling.ts # src/main/rate-limits/service/service-state.ts # src/main/rate-limits/service/service-types.ts # src/renderer/src/components/settings/appearance-status-bar-search.ts # src/renderer/src/components/status-bar/StatusBarProviderSegment.tsx # src/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsx # src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts # src/renderer/src/components/status-bar/status-bar-agent-gating.ts # src/renderer/src/components/status-bar/status-bar-provider-visibility.ts # src/renderer/src/components/status-bar/usage-provider-settings-target.ts # src/renderer/src/components/status-bar/use-status-bar-controller.ts # src/renderer/src/i18n/locales/en.json # src/renderer/src/store/slices/ui-hydration-workspace-preferences.test.ts # src/renderer/src/store/slices/ui/ui-slice-hydration-status-bar-items.ts # src/shared/persisted-ui-state-types.ts # src/shared/rate-limit-state-factory.ts # src/shared/rate-limit-types.test.ts # src/shared/rate-limit-types.ts # src/shared/rpc-contract/client-ui-params.ts # src/shared/status-bar-defaults.ts # src/shared/ui-chrome-types.ts
# Conflicts: # src/renderer/src/components/status-bar/StatusBarProviderSegment.tsx # src/renderer/src/i18n/locales/en.json
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change adds Kiro CLI usage fetching and integrates Kiro rate-limit state into refresh cycles and installed-agent detection. The fetcher parses usage and reset-date information and returns unavailable or error results for command failures. The status bar now supports Kiro visibility, provider details, reset labels, and settings. Kiro is added to default status-bar items through a persisted migration flag. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established for the reviewed changes. Complete the normal checks before merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4275e641-29f2-42be-ba78-4957faf6b8d7
📒 Files selected for processing (42)
src/main/rate-limits/kiro-usage-fetcher.test.tssrc/main/rate-limits/kiro-usage-fetcher.tssrc/main/rate-limits/rate-limit-service-test-harness.tssrc/main/rate-limits/service-account-target-selection.test.tssrc/main/rate-limits/service-antigravity-usage.test.tssrc/main/rate-limits/service-cursor-usage.test.tssrc/main/rate-limits/service-inactive-account-previews.test.tssrc/main/rate-limits/service-live-claude-usage.test.tssrc/main/rate-limits/service-minimax-usage.test.tssrc/main/rate-limits/service-opencode-go-credentials.test.tssrc/main/rate-limits/service-refresh-orchestration.test.tssrc/main/rate-limits/service-window-activation.test.tssrc/main/rate-limits/service-zcode-usage.test.tssrc/main/rate-limits/service/service-full-cycle-application.tssrc/main/rate-limits/service/service-full-cycle-preparation.tssrc/main/rate-limits/service/service-polling.tssrc/main/rate-limits/service/service-state.tssrc/main/rate-limits/service/service-types.tssrc/renderer/src/components/settings/appearance-status-bar-kiro-toggle-search.tssrc/renderer/src/components/settings/appearance-status-bar-search.tssrc/renderer/src/components/status-bar/StatusBar.tsxsrc/renderer/src/components/status-bar/StatusBarProviderSegment.tsxsrc/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsxsrc/renderer/src/components/status-bar/status-bar-agent-gating.test.tssrc/renderer/src/components/status-bar/status-bar-agent-gating.tssrc/renderer/src/components/status-bar/status-bar-provider-letter.test.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.tssrc/renderer/src/components/status-bar/tooltip-reset-label.test.tssrc/renderer/src/components/status-bar/tooltip.tsxsrc/renderer/src/components/status-bar/usage-error-copy.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.test.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.tssrc/renderer/src/components/status-bar/use-status-bar-controller.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/ui-hydration-workspace-preferences.test.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-status-bar-items.tssrc/shared/persisted-ui-state-types.tssrc/shared/rate-limit-state-factory.tssrc/shared/rate-limit-types.tssrc/shared/rpc-contract/client-ui-params.tssrc/shared/status-bar-defaults.tssrc/shared/ui-chrome-types.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
…-pr-14001-main-conflicts # Conflicts: # src/renderer/src/i18n/locales/en.json
|
@coderabbitai review |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7087be14-9a27-4ccb-8e9a-88493a17fd30
📒 Files selected for processing (11)
src/main/ipc/preflight-agent-detection.test.tssrc/main/preflight/agent-detection.tssrc/main/rate-limits/kiro-usage-fetcher.test.tssrc/main/rate-limits/kiro-usage-fetcher.tssrc/main/rate-limits/service-live-claude-usage.test.tssrc/renderer/src/components/status-bar/StatusBarProviderSegment.tsxsrc/renderer/src/components/status-bar/usage-provider-settings-target.test.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.tssrc/renderer/src/components/status-bar/use-status-bar-controller.tssrc/renderer/src/i18n/locales/en.jsonsrc/shared/rate-limit-types.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
|
@coderabbitai review |
|
Carries forward the fixes from stablyai#26390 that the stablyai#14001 head does not have: - Local agent detection validates a configured KIRO_CLI_PATH with the same resolution the usage fetcher uses, so a Kiro CLI outside PATH keeps its meter and menu toggle; an invalid configured command is not detected, and WSL detection is unaffected. - The usage command is killed at the 1 MiB output cap and truncated output is rejected instead of being parsed as a valid total. - Reset descriptions that are not ISO dates (for example "01/01") are kept as display text instead of failing to parse.
|
Closing in favor of #26639, which now carries everything from this PR so reviewers only need to look at one. #26639 builds on @guanbear's current #14001 head. The fixes from here that #14001 does not have are ported in 9cc7e7c:
Each comes with its tests. #26639 also adds Kiro agent status (pets, sidebar, completion notifications) and Kiro conversations in Agent session history. |
Carries forward the fixes from stablyai#26390 that the stablyai#14001 head does not have: - Local agent detection validates a configured KIRO_CLI_PATH with the same resolution the usage fetcher uses, so a Kiro CLI outside PATH keeps its meter and menu toggle; an invalid configured command is not detected, and WSL detection is unaffected. - The usage command is killed at the 1 MiB output cap and truncated output is rejected instead of being parsed as a valid total. - Reset descriptions that are not ISO dates (for example "01/01") are kept as display text instead of failing to parse.
ELI5
Orca now shows Kiro subscription credits in the status bar. A Kiro CLI configured outside the usual install paths is also detected, so its usage meter remains available.
What Changed
/usagecommand and integrated its plan, percentage, and reset description with rate-limit refresh and the status bar.Qlabel, and preference migration for existing profiles.KIRO_CLI_PATHwith the same command resolution used by the usage fetcher. An invalid configured command does not count as an installed agent..cmdhandling, cancellation, timeout, and bounded output.01/01without inventing a reset time.mainand resolved the Kiro integration conflicts.Why
Kiro already exposes subscription usage through its CLI. Reading that command avoids storing credentials or depending on a private API. Checking the configured executable in local detection keeps the meter and its menu toggle available when Kiro lives outside
PATH, while WSL and SSH continue detecting agents on their own execution hosts.Linked Issue
Related to #9559 (Kiro subscription). This PR builds on #14001.
Visual Proof
These screenshots were captured for #14001 on an earlier visual baseline. The current merge was verified with automated tests and typechecks.
Testing
pnpm tcpassed on Windows.pnpm run check:code-quality:changed -- e3639ef8d69209b8278b41c0e722811960ea7ec0passed on Windows.AI Disclosure
OpenAI Codex assisted with the review fix, merge resolution, and validation.
Review
The configured path affects local Kiro detection only. WSL and SSH use their own host detection. The fetcher runs a fixed argument list with bounded output and does not read or store credentials.
Agent skill upstream boundary
Notes
The screenshots reflect #14001's earlier visual baseline. macOS, Linux, SSH, mobile, and a visible Electron window were not manually tested for this update.
Checklist