Skip to content

feat(kiro): agent status, session history and usage fixes (builds on #14001) - #26639

Closed
w-felipe360 wants to merge 24 commits into
stablyai:mainfrom
w-felipe360:feat/kiro-agent-status-and-history
Closed

w-felipe360 wants to merge 24 commits into
stablyai:mainfrom
w-felipe360:feat/kiro-agent-status-and-history

Conversation

@w-felipe360

@w-felipe360 w-felipe360 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #14001 (@guanbear's Kiro usage credits) and supersedes #26390. This branch is #14001's current head plus the commits below, so until #14001 merges, the diff here also shows its changes. What to review here:

ELI5

Orca learns what a coding agent is doing by having the agent "ping" Orca at key moments (prompt sent, tool running, turn finished). It builds the session history by reading the files each agent saves. Kiro was set up for neither, so Orca could launch Kiro but could not tell when it was working or done, and could not see its past conversations. This PR teaches Orca both, and fixes three gaps in the Kiro usage meter.

What Changed

Before:

  • In a Kiro pane the pet never reacted.
  • The sidebar never showed Kiro as working.
  • No "agent finished" notification ever fired.
  • Agent session history had no Kiro conversations.

Other agents behaved normally.

After:

  • Kiro shows as working while it runs and flips to done when the turn ends. Pets react and the completion notification fires.
  • Kiro conversations appear in Agent session history with title, project, model and preview, and resume with one click.

Mechanism:

  1. Status hooks (src/main/kiro/). Kiro has no global hook file; hooks live inside each agent config.
    • Orca adds one managed hook per event (agentSpawn, userPromptSubmit, preToolUse, postToolUse, stop) to every global agent in $KIRO_HOME/agents/*.json (default ~/.kiro). User hooks are left untouched, and uninstall removes only Orca's entries.
    • The hook script posts to the existing hook server at /hook/kiro.
    • Kiro runs hooks through PowerShell on Windows and sh elsewhere, so the existing wrappers are reused. SSH hosts get the same install over SFTP.
  2. Event normalizer (providers/kiro-events.ts). Kiro's payload has the same fields as Claude's (session_id, prompt, tool_name, tool_input, assistant_response), only with camelCase event names, so it reuses the existing Claude tool-field extraction.
  3. Session history (session-scanner-kiro-parser.ts).
    • Reads $KIRO_HOME/sessions/cli/<id>.json (metadata) plus <id>.jsonl (transcript). The transcript is streamed, because tool outputs make these files megabytes.
    • Subagent child sessions (parent_session_id) are left out, the same way Claude's subagents are.
    • Works locally, under WSL and over SSH. The resume command is kiro-cli chat --tui --resume-id <id>.
  4. Usage meter fixes (from feat(usage): show Kiro subscription credits in the status bar #26390).
    • KIRO_CLI_PATH detection. Before: a Kiro CLI outside PATH was not detected, so its usage meter and menu toggle disappeared. After: local detection validates the configured command with the same resolution the usage fetcher uses. An invalid configured command is not detected, and WSL detection is unaffected.
    • Truncated output. Before: the /usage command was capped at 1 MiB, but a cut-off read could still be parsed as a real total. After: the process is killed at the cap and truncated output is rejected.
    • Reset text. Before: only YYYY-MM-DD reset dates parsed, so other descriptions such as 01/01 showed a parse error. After: any description is kept as display text, still without inventing a reset time.

Why

Hooks are the source of truth every other agent uses (the hook server's status store). Pets, sidebar, notifications and mobile therefore pick Kiro up with no reader-side changes.

Alternatives considered:

  • Terminal-screen rules. Kiro's terminal title is a static kiro and never reflects working or idle, so there is nothing reliable to match.
  • Launching Kiro with an Orca-owned --agent. This would override the user's chosen default agent and lose their tools and permissions.
  • Overriding the built-in kiro_default agent file. We can't reproduce its built-in config faithfully.

The usage fixes keep the meter honest. Detection and fetching resolve the same command, so the menu never offers a meter that cannot run, and a capped read is never shown as a real number.

Known limit: a user who only uses the built-in kiro_default agent has no file to patch. The hook status says so and points them to kiro-cli agent create.

Linked Issue

No separate issue: this is the agent-status and history follow-up to #14001, and it supersedes #26390 (related to #9559).

Visual Proof

A recording will follow in a comment. It shows a Kiro pane going idle → working → done with the pet and the notification, and Kiro rows in Agent session history.

Testing

Tested on Windows 11 with kiro-cli 2.28:

  • Real payloads. Captured Kiro's hook payloads in both --no-interactive and the --tui mode Orca launches. All five events fire in the TUI. Subagents do not fire the parent's hooks.
  • End to end.
    • Installed the real managed hooks into a throwaway home and ran Kiro against a local capture server.
    • userPromptSubmit → preToolUse → postToolUse → stop arrived on /hook/kiro with the right token and pane key.
    • Kiro's answer was unchanged, which confirms the hook writes nothing into the model context.
  • Real history. Parsed 452 real local Kiro sessions: 420 listed, 32 subagent children skipped, 0 failures, about 7 s cold for about 1.1 GB of transcripts.
  • Resume. Verified that kiro-cli chat --resume-id <id> restores the conversation.
  • Real usage. Ran the fetcher against the real CLI: KIRO POWER, 49.1% used, reset 2026-11-01.
  • Not manually tested: macOS, Linux and SSH hosts. These are covered by unit tests and the remote installer and source registries.

Automated:

  • New tests: src/main/kiro/hook-service.test.ts, providers/kiro-events.test.ts and session-scanner-kiro-parser.test.ts. Kiro is also added to the every-agent vault fixture and the hook registry coverage tests.

  • New usage tests: the non-ISO reset description, the output-limit kill and truncated-output rejection, and KIRO_CLI_PATH detection (configured command found, broken configured command, WSL unaffected).

  • Checks on this branch: tsc passes for node, cli and web, and the Kiro, hook-registry and usage tests pass.

  • Pre-existing Windows failures: 8 AI Vault scanner tests fail on Windows (EBUSY temp-dir cleanup and CODEX_HOME path quoting). They fail the same way on the base commit without this change.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Implemented with Claude Code (Claude Opus 5.5), directed and reviewed by me.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Remote compatibility:
    • Adding kiro to the resumable agents widens terminal.ensureAgentSession's enum. Kiro resume is therefore gated on a new agent-session.kiro-resume.v1 runtime capability, and older hosts fall back instead of failing.
    • Older clients filter out unknown agents, so they drop Kiro rows from a newer host's session list.
    • An older relay ignores /hook/kiro.
  • Security:
    • Orca edits user-owned Kiro agent files with an atomic write and a rolling .bak. Unparseable files are reported and left untouched.
    • Hook stdout stays silent, because Kiro injects agentSpawn/userPromptSubmit hook output into the model context.
  • Performance: transcripts are streamed line by line within the shared per-record byte budget. Kiro parses are cached by the .json and .jsonl stats.
  • Approval pauses have no Kiro hook, so they read as working: the agent is mid-tool.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

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
Kiro panes never reached the hook server, so pets, sidebar status and
"agent finished" notifications ignored them, and Kiro conversations were
missing from Agent session history.

- Install Orca status hooks into every global Kiro agent config
  (~/.kiro/agents/*.json), locally and over SSH, and normalize Kiro's
  agentSpawn/userPromptSubmit/preToolUse/postToolUse/stop events.
- Scan ~/.kiro/sessions/cli (<id>.json metadata + <id>.jsonl transcript)
  into the AI Vault, skipping subagent child sessions, with
  `kiro-cli chat --tui --resume-id <id>` as the resume command.
- Gate Kiro resume on a new agent-session.kiro-resume.v1 capability so
  older remote hosts never see the widened agent enum.
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a2b3b1ca-fd6f-4f82-a865-6d8ca7492ddb
📥 Commits

Reviewing files that changed from the base of the PR and between edd4fc3 and 1dfca61.

📒 Files selected for processing (2)
  • src/main/kiro/hook-service.test.ts
  • src/main/kiro/hook-service.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/kiro/hook-service.ts
  • src/main/kiro/hook-service.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The changes add Kiro support across managed hooks, hook-event processing, AI Vault session scanning and resume commands, and rate-limit reporting. The Kiro usage fetcher runs the CLI usage command and adds its results to rate-limit refresh cycles. The status bar adds Kiro usage visibility, settings controls, and reset-date labels. Tests and fixtures cover these changes.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 1dfca

The displayed agents path is correct for local and remote installations. No actionable merge-blocking risk remains for the supported Kiro workflow.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 71 functions across 60 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the Kiro feature and the main user-facing areas: agent status, session history, and usage fixes. It is concise and related to the changes.
Description check ✅ Passed The description is detailed and covers the required change scope, rationale, testing, security, compatibility, performance, and checklist items. It does not provide an actual linked issue and says vis…
  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 060a9241-17c4-4f49-a297-1f8f7d6e4789
📥 Commits

Reviewing files that changed from the base of the PR and between d997ef0 and 5c05ceb.

📒 Files selected for processing (81)
  • config/tsconfig.cli.json
  • src/main/agent-hooks/installer-utils-remote.ts
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/main/agent-hooks/managed-hook-command-contract.test.ts
  • src/main/agent-hooks/remote-hook-service-registry-coverage.test.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/agent-hooks/server-retired-pane-new-turn.test.ts
  • src/main/ai-vault/remote-session-scanner-kiro-source.ts
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-every-agent-fixture.ts
  • src/main/ai-vault/session-scanner-kiro-fixtures.ts
  • src/main/ai-vault/session-scanner-kiro-parser.test.ts
  • src/main/ai-vault/session-scanner-kiro-parser.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-coexistence.test.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-test-fixtures.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/session-scanner.test.ts
  • src/main/ipc/preflight-agent-detection.test.ts
  • src/main/kiro/hook-service.test.ts
  • src/main/kiro/hook-service.ts
  • src/main/kiro/hook-settings.ts
  • src/main/preflight/agent-detection.ts
  • src/main/rate-limits/kiro-usage-fetcher.test.ts
  • src/main/rate-limits/kiro-usage-fetcher.ts
  • 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-antigravity-usage.test.ts
  • src/main/rate-limits/service-cursor-usage.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-opencode-go-credentials.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-zcode-usage.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-kiro-toggle-search.ts
  • src/renderer/src/components/settings/appearance-status-bar-search.ts
  • src/renderer/src/components/status-bar/StatusBar.tsx
  • 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-letter.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/tooltip-reset-label.test.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.test.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/runtime/agent-resume-host-authority-capability.ts
  • 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/agent-hook-listener/provider-dispatch.ts
  • src/shared/agent-hook-listener/provider-event-routing.ts
  • src/shared/agent-hook-listener/providers/kiro-events.test.ts
  • src/shared/agent-hook-listener/providers/kiro-events.ts
  • src/shared/agent-hook-listener/providers/kiro-tool-fields.ts
  • src/shared/agent-hook-listener/source-routing.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-hook-types.ts
  • src/shared/agent-resume-argv.ts
  • src/shared/agent-session-resume-runtime-capabilities.ts
  • src/shared/agent-session-resume.ts
  • src/shared/ai-vault-resume-command.ts
  • src/shared/ai-vault-types.ts
  • src/shared/persisted-ui-state-types.ts
  • src/shared/rate-limit-state-factory.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

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/main/ai-vault/session-scanner-agent-sources.ts Outdated
Comment thread src/main/ai-vault/session-scanner-agent-sources.ts
@w-felipe360
w-felipe360 force-pushed the feat/kiro-agent-status-and-history branch from 5c05ceb to 6422766 Compare October 8, 2026 18:23
@w-felipe360 w-felipe360 changed the title feat(kiro): usage credits, agent status and session history feat(kiro): agent status and session history (builds on #14001) Oct 8, 2026
Kiro CLI uses $KIRO_HOME in place of ~/.kiro for both its agent configs
and its sessions (verified on kiro-cli 2.28), so a relocated home left
Kiro panes without status hooks and its conversations out of history.
Resolve both paths through one shared helper; SSH hosts keep the CLI's
default since their environment is not visible over SFTP.
@w-felipe360
w-felipe360 force-pushed the feat/kiro-agent-status-and-history branch from 52115b7 to 08f0a6f Compare October 8, 2026 18:37

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77a2aac7-034f-4ad5-ba05-7f0ba168d4e0
📥 Commits

Reviewing files that changed from the base of the PR and between 6422766 and 08f0a6f.

📒 Files selected for processing (6)
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-kiro-parser.ts
  • src/main/kiro/hook-service.test.ts
  • src/main/kiro/hook-settings.ts
  • src/shared/kiro-home.test.ts
  • src/shared/kiro-home.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Comment thread src/main/kiro/hook-settings.ts Outdated
…tus-and-history

# Conflicts:
#	src/renderer/src/i18n/locales/en.json
…ice suites

The shared rate-limit test harness resets fetchKiroRateLimits on every run, so a suite that does not mock kiro-usage-fetcher fails before its first assertion with 'mockResolvedValue is not a function'. These two suites lost the mock in an earlier rebase of the Kiro usage branch.
On an SSH host the Kiro installer always patched <home>/.kiro/agents, so a
host that sets KIRO_HOME got hooks on inactive configs and none on the
agents Kiro actually loads. The host-side runtime now reads KIRO_HOME from
the login shell, the same probe it already runs for GROK_HOME (both run in
parallel), and the installer and its status use that one directory.

Adding the test exposed that the host-side SFTP stand-in returned an empty
readdir, so the remote install could never see any Kiro agent. It now
returns entry names, matching the WSL adapter.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d5c0110d-0fa4-4c45-9ae5-b3f91c80a067
📥 Commits

Reviewing files that changed from the base of the PR and between 08f0a6f and edd4fc3.

📒 Files selected for processing (17)
  • config/tsconfig.cli.json
  • src/main/agent-hooks/managed-hook-local-filesystem.ts
  • src/main/agent-hooks/managed-hook-runtime.test.ts
  • src/main/agent-hooks/managed-hook-runtime.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/kiro/hook-service.test.ts
  • src/main/kiro/hook-service.ts
  • src/main/kiro/hook-settings.ts
  • src/main/rate-limits/service-cursor-usage.test.ts
  • src/main/rate-limits/service-live-claude-usage.test.ts
  • src/main/rate-limits/service-opencode-go-credentials.test.ts
  • src/renderer/src/components/status-bar/StatusBarProviderSegment.tsx
  • 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/shared/agent-resume-argv.ts
  • src/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; 6 remain after this review.

Comment thread src/main/kiro/hook-service.ts Outdated
The detail always said ~/.kiro/agents, which points users to the wrong place when KIRO_HOME is set locally or probed on an SSH host.
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.
@w-felipe360 w-felipe360 changed the title feat(kiro): agent status and session history (builds on #14001) feat(kiro): agent status, session history and usage fixes (builds on #14001) Oct 8, 2026
@w-felipe360 w-felipe360 closed this Oct 9, 2026
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@w-felipe360 Thanks for the update and for carrying the fixes into #26695. The split separates Kiro agent status and session history from the usage changes discussed on #14001, giving each PR a clearer review scope.


🧠 Learnings used
Learnt from: w-felipe360
Repo: stablyai/orca

Timestamp: 2026-10-08T18:48:55.304Z
Learning: Kiro CLI 2.28 treats an absolute KIRO_HOME as a complete replacement for ~/.kiro: sessions reside in $KIRO_HOME/sessions/cli and agent configurations in $KIRO_HOME/agents. In this repository, src/shared/kiro-home.ts provides the shared local home resolver for session discovery and status hooks. Relative KIRO_HOME values are ignored, and kiroSessionsDir remains the explicit scan override. SSH session discovery and hook installation intentionally use the CLI default remote home because remote KIRO_HOME is not visible over SFTP.

Learnt from: w-felipe360
Repo: stablyai/orca PR: 26639
File: src/main/ai-vault/session-scanner-agent-sources.ts:237-249
Timestamp: 2026-10-08T18:48:52.490Z
Learning: In stablyai/orca, the Kiro integration launches `kiro-cli chat --tui`, not the Kiro ACP server. The TypeScript AI Vault scanner in `src/main/ai-vault/session-scanner-agent-sources.ts` and `src/main/ai-vault/session-scanner-kiro-parser.ts` intentionally reads CLI v2 sessions from `$KIRO_HOME/sessions/cli/<id>.json` and adjacent `.jsonl` transcripts without modifying Kiro session files. The author verified this store and `kiro-cli chat --resume-id` behavior on kiro-cli 2.28. Do not require V3 ACP `session/list` for this interactive CLI integration; ACP session discovery would belong to a separate ACP integration.

If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

@w-felipe360

Copy link
Copy Markdown
Contributor Author

Closing this in favor of smaller PRs that don't depend on each other.

Kiro agent status and session history are now in the new Kiro PR (fixes #26694). It's built on main and has a before/after video. I suggested the usage fixes (KIRO_CLI_PATH detection, truncated output, non-ISO reset text) on #14001 instead, since they belong next to the usage fetcher there.

Thanks to CodeRabbit for the reviews here. The fixes from this thread carried over to the new Kiro PR.

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.

2 participants