Repository navigation
feat(kiro): Kiro account usage tracking and status-bar integration - #23650
JuanmanDev wants to merge 3 commits into
Conversation
Add Kiro CLI engine support with account usage tracking, status-bar provider segment, settings accounts section, and mobile usage section. Includes reset-credit indicator, usage reconciliation, and terminal title/conversation-name derivation for Kiro rows.
# Conflicts: # .gitignore # mobile/src/components/accounts-snapshot.ts # src/main/runtime/rpc/methods/client-ui-schemas.ts # src/main/runtime/runtime-worktree-agent-startup.ts # src/preload/api-types.ts # src/preload/index.ts # src/renderer/src/components/settings/AccountsPane.tsx # src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts # src/renderer/src/components/status-bar/status-bar-provider-visibility.ts # src/renderer/src/components/status-bar/tooltip.tsx # src/renderer/src/components/status-bar/usage-error-copy.ts # src/renderer/src/components/status-bar/usage-provider-settings-target.ts # src/renderer/src/components/status-bar/use-status-bar-controller.ts # src/shared/agent-row-conversation-name.ts # src/shared/agent-session-option-catalog.ts # src/shared/rate-limit-state-factory.ts # src/shared/rate-limit-types.test.ts # src/shared/rate-limit-types.ts # src/shared/terminal-title-agent-type.ts # src/shared/tui-agent-config.ts
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe changes add Kiro CLI usage parsing, refresh, storage, and display in renderer and mobile interfaces. They add Kiro session options, terminal-title recognition, and local and remote terminal-title setup. The status bar gains Kiro usage controls and Codex reset-credit badges. The root ignore rules now exclude Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to Resolve the remote settings overwrite risk before merging. The local preflight should also respect KIRO_HOME so it changes the profile the user actually selected. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Kiro usage is integrated across desktop and mobile, while agent launch can now change settings on a remote host. A remote settings-read failure could cause existing settings to be replaced, although the write is limited to configured Kiro launches. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 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: 6
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 8fa0f45b-972c-466c-b152-dbf618e367a1
📒 Files selected for processing (79)
.gitignoremobile/app/h/[hostId]/accounts.tsxmobile/src/accounts-route-reset-credit.test.tsmobile/src/components/AccountUsage.tsxmobile/src/components/MobileKiroUsageSection.tsxmobile/src/components/account-usage-state.test.tsmobile/src/components/account-usage-state.tsmobile/src/components/accounts-snapshot.test.tsmobile/src/components/accounts-snapshot.tsscripts/dev-local.shsrc/main/ipc/kiro-usage.test.tssrc/main/ipc/kiro-usage.tssrc/main/ipc/register-core-handlers/register-core-handlers.test.tssrc/main/ipc/register-core-handlers/register-core-handlers.tssrc/main/kiro-usage/kiro-usage-background-refresh.test.tssrc/main/kiro-usage/kiro-usage-background-refresh.tssrc/main/kiro-usage/kiro-usage-fetcher.test.tssrc/main/kiro-usage/kiro-usage-fetcher.tssrc/main/kiro-usage/kiro-usage-parser.test.tssrc/main/kiro-usage/kiro-usage-parser.tssrc/main/kiro-usage/kiro-usage-refresh-registry.tssrc/main/kiro-usage/kiro-usage-to-rate-limits.test.tssrc/main/kiro-usage/kiro-usage-to-rate-limits.tssrc/main/kiro/kiro-terminal-title-setting.test.tssrc/main/kiro/kiro-terminal-title-setting.tssrc/main/rate-limits/service/service-configuration.tssrc/main/rate-limits/service/service-state.tssrc/main/rate-limits/service/service-types.tssrc/main/runtime/orca-runtime-activate-managed-worktree.tssrc/main/runtime/runtime-account-controller.tssrc/main/runtime/runtime-worktree-agent-startup.tssrc/preload/api-types.tssrc/preload/api/kiro-usage-api.tssrc/preload/api/kiro-usage-bridge.tssrc/preload/index.tssrc/renderer/src/components/settings/AccountsPane.tsxsrc/renderer/src/components/settings/KiroAccountsSection.tsxsrc/renderer/src/components/sidebar/worktree-title-derived-agent-rows.tssrc/renderer/src/components/sidebar/worktree-title-derived-kiro-row.test.tssrc/renderer/src/components/status-bar/StatusBarProviderSegment.tsxsrc/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsxsrc/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsxsrc/renderer/src/components/status-bar/reset-credit-indicator.test.tssrc/renderer/src/components/status-bar/reset-credit-indicator.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.test.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.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.tssrc/renderer/src/components/status-bar/use-status-bar-controller.tssrc/renderer/src/store/index.tssrc/renderer/src/store/slices/kiro-usage.test.tssrc/renderer/src/store/slices/kiro-usage.tssrc/renderer/src/store/slices/rate-limits.test.tssrc/renderer/src/store/slices/store-test-helpers.tssrc/renderer/src/store/types.tssrc/shared/agent-row-conversation-name.tssrc/shared/agent-session-option-catalog-kiro.test.tssrc/shared/agent-session-option-catalog-kiro.tssrc/shared/agent-session-option-catalog.tssrc/shared/agent-title-evidence.tssrc/shared/agent-title-identity.tssrc/shared/agent-title-status.tssrc/shared/kiro-cli-engine.test.tssrc/shared/kiro-cli-engine.tssrc/shared/kiro-row-conversation-name.test.tssrc/shared/kiro-terminal-title.test.tssrc/shared/kiro-terminal-title.tssrc/shared/kiro-usage-reconcile.test.tssrc/shared/kiro-usage-reconcile.tssrc/shared/kiro-usage-types.tssrc/shared/rate-limit-state-factory.tssrc/shared/rate-limit-types.test.tssrc/shared/rate-limit-types.tssrc/shared/rpc-contract/client-ui-params.tssrc/shared/status-bar-defaults.tssrc/shared/terminal-title-agent-type.tssrc/shared/tui-agent-config.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.
There was a problem hiding this comment.
Important
The new kiro-usage status-bar item is added to the shared defaults but not to the one-shot hydration migration, so existing users never receive it by default. Two smaller items are inline.
Reviewed changes
- Kiro usage pipeline (
src/main/kiro-usage/*,src/shared/kiro-usage-*): runskiro-cli chat --agent-engine v2 --no-interactive /usage, parses the monthly plan meter, retries transient failures, reconciles stale reads, and converts to a monthlyProviderRateLimits. - State and plumbing:
RateLimitState.kiro,setKiroUsage/getKiroUsage, exclusion ofkirofrom the actively-polled provider set, and the desktop IPC / phone RPC refresh lanes. - Surfaces:
kiro-usagestatus-bar item plus visibility menu and roster segment,KiroAccountsSectionin Settings, and the mobile usage section with snapshot schema additions. - Kiro identity:
kiro:title detection, the vendorchat.terminalTitlepre-launch write, and the Kiro agent-session option catalog (models, engine, effort). - Bundled, unrelated: an inline Codex reset-credit badge and a committed
scripts/dev-local.sh.
⚠️ kiro-usage is default-on for new profiles only, not existing users
'kiro-usage' was appended to DEFAULT_STATUS_BAR_ITEMS, but the one-shot hydration migration that delivers newly default-on items to existing users was not extended. Because migrateStatusBarItems only falls back to DEFAULT_STATUS_BAR_ITEMS when statusBarItems is undefined, a user who has ever persisted UI state will not get the Kiro segment by default — they must enable it manually, which contradicts the default-on intent and diverges from how grok/cursor/zcode were shipped.
Technical details
# Missing `_kiroStatusBarDefaultAdded` migration
## Affected sites
- `src/shared/status-bar-defaults.ts:17` — adds `'kiro-usage'` to `DEFAULT_STATUS_BAR_ITEMS`; only consulted when no persisted `statusBarItems` exists.
- `src/renderer/src/store/slices/ui/ui-slice-hydration-status-bar-items.ts:5-28` — `DEFAULT_ON_*` constants and the `defaults` loop that appends each item once its flag is stamped; has no Kiro entry.
- `src/shared/persisted-ui-state-types.ts:111-124` — declares `_ports/_kimi/_minimax/_antigravity/_grok/_cursor/_zcodeStatusBarDefaultAdded`; no `_kiroStatusBarDefaultAdded`.
- `src/shared/rpc-contract/client-ui-params.ts:182-189` — the paired `UiUpdateFields` mirror of those flags; also missing the Kiro flag.
## Required outcome
An existing user with a persisted `statusBarItems` array should receive `kiro-usage` exactly once, the same way grok/cursor/zcode do, without clobbering a user who later toggles it off.
## Suggested approach
Mirror the zcode/cursor/grok pattern in all four sites: a `DEFAULT_ON_KIRO_STATUS_BAR_ITEM` constant and `defaults` entry in `ui-slice-hydration-status-bar-items.ts`, the `_kiroStatusBarDefaultAdded?: boolean` field in `persisted-ui-state-types.ts`, and the matching optional flag in `client-ui-params.ts`.
## Open questions for the human
If keeping the segment opt-in for existing users is deliberate, then dropping it from `DEFAULT_STATUS_BAR_ITEMS` would make that intent consistent; as written the two disagree.ℹ️ Nitpicks
- This PR bundles an unrelated Codex reset-credit status-bar badge (
reset-credit-indicator.ts,ResetCreditBadge, its tests) and a machine-specificscripts/dev-local.shinto an already large Kiro change. Splitting these would make the Kiro feature easier to review and revert independently. getProviderLetterreturns'Ki'(two characters) for Kiro while every other provider is one; fine if the compact badge is sized for it, but worth a visual check.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Resolves the CodeRabbit and Pullfrog findings on stablyai#23650. Correctness: - Clamp the parsed `/usage` percentage to 0-100 and read it only from the meter that follows the credits line, and only when it agrees with used/limit. An over-plan quota previously made the mobile accounts snapshot reject every provider, and a stray `%` in the combined stdout/stderr blob could be mistaken for the plan meter. - Emit `--effort` only when the user picks a level. The catalog default now sends no flag, so Kiro's own saved `chat.modelDefaults` effort stands. - Do not read a native title envelope's session text as a second owner claim: `kiro: fix the pager - codex` resolved to a conflict instead of Kiro. - Reject a decorated wrapper segment in the Kiro title regex, so a Claude task title such as `✳ Review | kiro: usage` is no longer classified as a Kiro pane. Launch preflight: - Write `chat.terminalTitle` through `kiro-cli settings` instead of rewriting the whole settings file, which could erase a model or effort change another Kiro session persisted in between. - Add the SSH-host half of the preflight. Kiro runs on the execution host, so a local-only write left remote panes without their identity signal. Remote home resolution moves to `src/main/ssh/remote-agent-home.ts` and is shared with the remote trust presets. Surfaces: - Deliver the default-on `kiro-usage` status-bar item to existing users via the one-shot hydration migration, not just to fresh profiles. - Gate the Kiro accounts section behind the settings search like every other provider, and give it search entries so "kiro" finds it. Housekeeping: - Drop the machine-specific `scripts/dev-local.sh`. - Clear the changed-code quality gate: SAFETY rationale on the remaining casts, no restyles of `Button`/`Badge`, and no duplicate test imports. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 5d7aa09c-c7a1-4f03-9749-04d6e37d0a2d
📒 Files selected for processing (31)
mobile/src/components/account-usage-state.test.tsmobile/src/components/accounts-snapshot.test.tssrc/main/ipc/kiro-usage.test.tssrc/main/kiro-usage/kiro-usage-parser.test.tssrc/main/kiro-usage/kiro-usage-parser.tssrc/main/kiro-usage/kiro-usage-refresh-registry.tssrc/main/kiro/kiro-remote-terminal-title-setting.test.tssrc/main/kiro/kiro-remote-terminal-title-setting.tssrc/main/kiro/kiro-terminal-title-setting.test.tssrc/main/kiro/kiro-terminal-title-setting.tssrc/main/remote-agent-trust-presets.tssrc/main/runtime/orca-runtime-activate-managed-worktree.tssrc/main/runtime/runtime-worktree-agent-startup.tssrc/main/ssh/remote-agent-home.tssrc/preload/api/kiro-usage-bridge.tssrc/renderer/src/components/settings/AccountsPane.tsxsrc/renderer/src/components/settings/KiroAccountsSection.tsxsrc/renderer/src/components/settings/accounts-search.tssrc/renderer/src/components/sidebar/worktree-title-derived-kiro-row.test.tssrc/renderer/src/components/status-bar/reset-credit-indicator.test.tssrc/renderer/src/store/slices/kiro-usage.test.tssrc/renderer/src/store/slices/kiro-usage.tssrc/renderer/src/store/slices/ui-hydration-workspace-preferences.test.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-status-bar-items.tssrc/shared/agent-session-option-catalog-kiro.test.tssrc/shared/agent-session-option-catalog-kiro.tssrc/shared/agent-title-evidence.tssrc/shared/kiro-terminal-title.test.tssrc/shared/kiro-terminal-title.tssrc/shared/persisted-ui-state-types.tssrc/shared/rpc-contract/client-ui-params.ts
🚧 Files skipped from review as they are similar to previous changes (10)
- src/preload/api/kiro-usage-bridge.ts
- src/main/kiro-usage/kiro-usage-refresh-registry.ts
- src/renderer/src/store/slices/kiro-usage.ts
- src/renderer/src/components/status-bar/reset-credit-indicator.test.ts
- src/renderer/src/components/sidebar/worktree-title-derived-kiro-row.test.ts
- src/main/ipc/kiro-usage.test.ts
- src/shared/kiro-terminal-title.test.ts
- src/shared/agent-session-option-catalog-kiro.test.ts
- src/renderer/src/components/settings/KiroAccountsSection.tsx
- src/shared/kiro-terminal-title.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.
| } catch { | ||
| return '' | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Do not treat every remote stat error as a missing file.
If stat fails transiently for an existing cli.json, this helper returns an empty document. If the later write succeeds, Line 48 replaces the user’s other Kiro settings. Return the missing-file result only for a confirmed not-found error; fail without writing for other errors.
| export async function enableKiroTerminalTitle( | ||
| options: EnableKiroTerminalTitleOptions = {} | ||
| ): Promise<KiroTerminalTitleResult> { | ||
| const settings = readKiroSettings(options.settingsPath ?? getKiroCliSettingsPath()) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- diff stat ---'
git diff --stat aedb9305cd1b3de859b5eafc1ee0d77fa0df8963 8a41f3bba434fb3a4eb4e040389836e525e89f6a -- src/main/kiro
printf '%s\n' '--- target file outlines ---'
ast-grep outline src/main/kiro/kiro-terminal-title-setting.ts
ast-grep outline src/main/kiro/kiro-remote-terminal-title-setting.ts
printf '%s\n' '--- local helper ---'
cat -n src/main/kiro/kiro-terminal-title-setting.ts
printf '%s\n' '--- remote helper ---'
cat -n src/main/kiro/kiro-remote-terminal-title-setting.ts
printf '%s\n' '--- direct references and environment/path bindings ---'
rg -n -C 3 'enableKiroTerminalTitle|getKiroCliSettingsPath|KIRO_HOME|kiro-cli settings|remoteHome|run.*kiro|spawn.*kiro|exec.*kiro' src/main src --glob '!**/node_modules/**'
printf '%s\n' '--- changed hunks ---'
git diff --unified=30 aedb9305cd1b3de859b5eafc1ee0d77fa0df8963 8a41f3bba434fb3a4eb4e040389836e525e89f6a -- src/main/kiro/kiro-terminal-title-setting.ts src/main/kiro/kiro-remote-terminal-title-setting.tsRepository: stablyai/orca
Length of output: 45649
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions
Length of output: 44350
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- all direct callers ---'
rg -n -C 8 'enableRemoteKiroTerminalTitle|enableKiroTerminalTitle' src --glob '*.ts' --glob '*.tsx'
printf '%s\n' '--- Kiro launch and environment references ---'
rg -n -C 5 'kiro|KIRO_HOME|kiro-cli' src/main src/shared --glob '*.ts' --glob '*.tsx' | rg -i -C 5 'kiro|KIRO_HOME|terminal.title|terminalTitle|environment|env|spawn|command|launch'
printf '%s\n' '--- startup context ---'
sed -n '150,215p' src/main/runtime/runtime-worktree-agent-startup.ts
printf '%s\n' '--- process runner contract ---'
cat -n src/shared/child-process/run-process.ts
printf '%s\n' '--- exact symbols in prior full log ---'
rg -n -C 10 'enableRemoteKiroTerminalTitle|enableKiroTerminalTitle|KIRO_HOME|runtime-worktree-agent-startup' /tmp/coderabbit-shell-logs/shell-output-dkkakt || trueRepository: stablyai/orca
Length of output: 42448
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- runProcess implementation ---'
cat -n src/shared/child-process/run-process.ts
printf '%s\n' '--- Kiro configuration and launch bindings ---'
rg -n -C 8 'kiro-terminal-title|kiro-cli|TUI_AGENT_CONFIG|launchPlatform|command.*kiro|kiro.*command|env:' src/shared src/main --glob '*.ts' --glob '*.tsx' | head -n 1200
printf '%s\n' '--- process option construction ---'
rg -n -C 6 'runProcess\\(|spawn\\(|execFile\\(|shell:|env:' src/main src/shared --glob '*.ts' --glob '*.tsx' | rg -C 4 'agent|launch|kiro|runProcess|spawn|execFile|env'Repository: stablyai/orca
Length of output: 41432
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- process spec ---'
cat -n src/shared/child-process/process-spec.ts
printf '%s\n' '--- spawn resolution ---'
cat -n src/shared/child-process/spawn-resolution.ts
printf '%s\n' '--- locate TUI config and startup definitions ---'
rg -n 'export const TUI_AGENT_CONFIG|kiro:|kiro-cli|function buildAgentStartupPlan|export function buildAgentStartupPlan' src/shared --glob '*.ts'
printf '%s\n' '--- TUI config ---'
cat -n src/shared/tui-agent-config.ts
printf '%s\n' '--- startup implementation ---'
rg -n -C 12 'buildAgentStartupPlan|launchCommand|TUI_AGENT_CONFIG\[agent\]' src/shared/tui-agent-startup.ts src/main --glob '*.ts' | head -n 1000Repository: stablyai/orca
Length of output: 42237
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- remote home resolution ---'
rg -n -C 12 'export async function resolveRemoteAgentHome|function resolveRemoteAgentHome|resolveRemoteAgentHome' src/main/ssh src/main --glob '*.ts'
printf '%s\n' '--- remote terminal launch bindings ---'
rg -n -C 8 'startup\\.command|launchConfig|startupCommandDelivery|create.*Terminal|pty|shell' src/main/runtime src/main/ssh src/main/terminal src/shared --glob '*.ts' | head -n 1600Repository: stablyai/orca
Length of output: 42356
🌐 Web query:
site:kiro.dev/docs/cli/reference/settings KIRO_HOME cli.json settings directory
💡 Result:
Kiro CLI stores settings in `~/.kiro/settings/cli.json`. Setting `KIRO_HOME` overrides the `~/.kiro` base directory, so the settings file becomes `$KIRO_HOME/settings/cli.json`. ([kiro.dev](https://kiro.dev/docs/cli/reference/settings/?utm_source=openai))
Citations:
- 1: https://kiro.dev/docs/cli/reference/settings/?utm_source=openai
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- launch payload definitions ---'
rg -n -C 8 'type WorktreeStartupLaunch|interface WorktreeStartupLaunch|WorktreeStartupLaunch|startupCommandDelivery|launchConfig' src --glob '*.ts' --glob '*.tsx' | head -n 1800
printf '%s\n' '--- environment construction around terminal creation ---'
rg -n -C 10 'env:.*startup|startup.*env|spawn.*env|processEnv|environment:' src/main src/renderer src/shared --glob '*.ts' --glob '*.tsx' | head -n 1800Repository: stablyai/orca
Length of output: 45660
Use the effective KIRO_HOME for the local settings preflight.
When KIRO_HOME is set, Kiro reads $KIRO_HOME/settings/cli.json. The current helper reads homedir()/.kiro/settings/cli.json, while kiro-cli settings inherits the process environment. The preflight can therefore enable the wrong profile or ignore an explicit false.
Suggested fix
export function getKiroCliSettingsPath(): string {
- return join(homedir(), '.kiro', 'settings', 'cli.json')
+ return join(process.env.KIRO_HOME || join(homedir(), '.kiro'), 'settings', 'cli.json')
}📍 Affects 2 files
src/main/kiro/kiro-terminal-title-setting.ts#L64-L64(this comment)src/main/kiro/kiro-remote-terminal-title-setting.ts#L21-L22
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the fix commit 8a41f3bba4 on top of the prior review at f5e467f8c5; it addresses every prior Pullfrog and CodeRabbit finding and introduces no new behavioral issues.
- Usage percentage hardened (
kiro-usage-parser.ts): the%is read only from the meter after the credits line and trusted only when it agrees withused/limit; the result is clamped to 0–100, so an over-plan quota can no longer invalidate the mobile accounts snapshot. - Reasoning effort left to the CLI (
agent-session-option-catalog-kiro.ts): the default is now aCLI defaultchoice that emits no--effort, preserving a savedchat.modelDefaultslevel. - Title identity tightened (
kiro-terminal-title.ts,agent-title-evidence.ts): a decorated wrapper segment (status glyph, or Claude's./*) no longer mints a Kiro identity, and a native envelope's session text is no longer read as a second owner claim. - Terminal-title preflight on the execution host (
kiro-remote-terminal-title-setting.ts,remote-agent-home.ts,runtime-worktree-agent-startup.ts): the local write goes throughkiro-cli settings(single key, no whole-file clobber) and the SSH path gets its own filesystem-provider write; remote home resolution is shared with the trust presets. - Default-on migration and settings search (
ui-slice-hydration-status-bar-items.ts,persisted-ui-state-types.ts,client-ui-params.ts,AccountsPane.tsx,accounts-search.ts): existing users receivekiro-usageonce via the one-shot hydration flag, and the Kiro section is now gated and indexed by the settings search. - Housekeeping:
scripts/dev-local.shremoved; test import/type cleanups.
ℹ️ Nitpicks
applyLocalAgentLaunchPreflight/applyRemoteAgentLaunchPreflighthave no test that exercises the gate and the writer call together (the writers themselves are unit-tested). Defer-able.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏




ELI5
Adds Kiro to Orca's account and usage features. You can now see your Kiro CLI usage in the status bar (and on mobile) and manage the Kiro account in Settings, the same way Claude, Codex, Grok, and the other providers already work.
What Changed
kiro-cli-engine, session option catalog, terminal-title/conversation-name derivation for Kiro rows).kiro-usagestatus-bar segment with a roster meter and a reset-credit indicator, gated on thekiroCLI being on PATH (mirrors how Grok is handled). Existing users receive it through the same one-shot hydration migration used for Grok/Cursor/ZCode, so it is default-on for them too, not only for fresh profiles.KiroAccountsSection), always available since Kiro is CLI/SSO-auth with no persisted credential to gate on, and searchable like every other provider section.MobileKiroUsageSection) and Kiro entries in the mobile accounts snapshot.kiro-usage-reconcile) and sharedkiro-usage-types, wired through the preload bridge/API and the renderer store slice.chat.terminalTitlesetting, on the local machine throughkiro-cli settingsand on an SSH execution host through the remote filesystem provider.Before: Kiro ran as an agent but had no first-class usage visibility or account management, and a Kiro pane had no identity in the sidebar. After: Kiro appears in the status bar, Settings → Accounts, and mobile alongside the other providers, and its panes identify themselves.
Why
Kiro was already a supported agent but lacked the usage/account parity the other providers have. Because Kiro is CLI/SSO-authenticated (no persisted credential), its visibility keys off the
kiroCLI on PATH plus the status-bar item toggle — the same durable-signal approach already used for Grok — rather than a credential check.Two design choices worth calling out:
kiro-cli settingsrather than a whole-file write.chat.terminalTitleis off by default, and that title (kiro: <session>) is the only thing Kiro emits that identifies the pane. Orca only sets the key when it is absent, so a user who turns it off is never overridden. Rewriting the wholecli.jsonwould have erased a model or effort change another Kiro session persisted between Orca's read and its write, so the single-key CLI command is used instead. The remote half goes through the filesystem provider, the same contract the remote Codex and Copilot trust writes already use.--effortis only emitted when the user picks a level. The flag is a session override that beats the effort saved inchat.modelDefaults, so an untouched picker sends nothing and Kiro's own saved preference stands.Linked Issue
Fixes #9559
Fixes #7693
Visual Proof
Before: none of this existed. Kiro ran as an agent, but there was no Kiro row in the usage roster, no Kiro segment in the status bar, and no Kiro section in Settings → Accounts — the screens below simply had no Kiro in them.
After:
Settings → Accounts → Kiro, sitting alongside the existing providers. No credential to manage, so the section shows the plan tier, a manual refresh, and the monthly meter:
43%,432.42 / 1000 credits,Resets 2026-10-01.Status bar and usage roster (detailed). Kiro appears in the footer next to Claude (
43% used 2d 4h), as a roster row with its 30-day meter, and in the provider panel with the monthly window, credit count and reset countdown.Compact mode, which is the density the status bar collapses to.
Testing
Ran the dev build locally on macOS (Electron app launches; node-pty rebuilt for this machine's toolchain).
pnpm typecheckpasses: web, node, and cli.pnpm run check:code-quality:changedpasses across all 85 changed files (code quality, casting, focused plugins, type-aware, React Doctor, design system, SAFETY rationale).Test suites for every touched area pass:
mobile/src,src/main/kiro,src/main/kiro-usage,src/main/ipc/kiro-usage,src/main/runtime,src/preload,src/renderer/src/store/slices,src/renderer/src/components/{sidebar,status-bar,settings}, and all ofsrc/shared.Not run locally:
pnpm build(native toolchain limitation on this machine) — CI covers it.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Unit tests cover the new shared logic (
kiro-cli-engine,kiro-usage-reconcile,kiro-terminal-title,kiro-row-conversation-name, status-barreset-credit-indicator, store slice, mobile account usage state) plus regressions for each review finding: the clamped/anchored usage percentage, the untouched-effort launch, the Kiro title envelope not claiming a trailing owner name, the decorated-wrapper rejection, and both the local and remote terminal-title preflights.AI Disclosure
Claude Opus 5 (1M context) via Claude Code was used for the implementation and for applying the review feedback. All changes were reviewed before committing.
Review
Review feedback from CodeRabbit and Pullfrog has been applied in full:
usedPercentcould exceed 100 and make the mobile accounts snapshot reject every providerkiro-usage-parser%match scanned the whole stdout+stderr blob, so a stray%could become the plan percentageused/limit--effort mediumwas emitted for an untouched picker, discarding the user's saved Kiro effortCLI default, which emits no flagkiro: fix the pager - codexresolved toconflicting-anchored-namesinstead of Kiro✳ Review | kiro: usage(a Claude task title) was classified as a Kiro pane./*prefixescli.jsonwrite could erase a concurrent Kiro settings changekiro-cli settings chat.terminalTitle true, after the same existing-key checkapplyRemoteAgentLaunchPreflight, writing through the remote filesystem providerkiro-usagewas default-on for new profiles only_kiroStatusBarDefaultAddedto the one-shot hydration migration, its persisted type, and the RPC mirrorgetAccountsKiroSearchEntriesand wrapped the section inmatchesSettingsSearchscripts/dev-local.shwas machine-specificTwo review notes deliberately left as-is:
getProviderLetterreturns'Ki'. Single letters are exhausted around Kiro (Kis Kimi), andProviderLetterBadgehas no fixed width, so two characters lay out correctly. It is also only reached by the icon-only narrow status bar — every screenshot above shows the Kiro glyph instead — so a single arbitrary letter would be less readable without being more visible.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
runProcesswith an argument array, a bounded timeout and captured output — no shell, no dynamic command string. The Kiro settings write is a single-keykiro-cli settingscall.pathjoins.src/main/ssh/remote-agent-home.tsand is shared with the remote trust presets rather than duplicated.kiro/kiro-usageare additive to the provider unions, rate-limit records, and the sharedStatusBarItemenum. The mobile snapshot decodes hosts that omitkiroentirely, which is covered by a test./usageread is a background, deduplicated call with a freshness window; the terminal-title preflight only runs when the key is absent.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) —pnpm buildnot run locally (native toolchain limitation on this machine)🤖 Generated with Claude Code