Skip to content

fix(kiro): report status on Kiro's V3 engine, including the built-in default agent - #33660

Merged
nwparker merged 8 commits into
mainfrom
nwparker/agint-kiro-v3-default-agent
Oct 25, 2026
Merged

nwparker merged 8 commits into
mainfrom
nwparker/agint-kiro-v3-default-agent

Conversation

@nwparker

@nwparker nwparker commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​260 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​255
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​271 $\color{#cf222e}{\Huge{\mathbf{−}}}$​22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​249

ELI5

Kiro's next engine (V3) is turned on by --v3, and kiro-cli 2.30+ prompts users to switch to it. It becomes the default in Kiro CLI 3.0. On V3, Orca shows no Kiro status, for two reasons: V3 sends hook event names Orca doesn't recognise, and Kiro's built-in default agent never runs Orca's hooks. This PR teaches Orca the V3 event names. It also installs one global V3 hooks file that covers every agent, including the built-in default.

This adopts @LDH1103's #24937, with their commits kept, merged onto current main and trimmed. On top of that is one fix-up commit.

What Changed

  • normalizeKiroEvent now accepts V3's PascalCase names. UserPromptSubmit/PreToolUse/PostToolUse mean working, and Stop/SessionEnd mean done. SessionStart is ignored because V3 fires it lazily, right before the first prompt. The camelCase V2 mapping is unchanged.
  • KiroHookService.install() / installRemote() also write orca-agent-status.json (Kiro's version: "v1" standalone format) into Kiro's global hooks dir. It runs the same managed kiro-hook script. A file at that name with anything Orca didn't write is left alone and reported. remove() deletes the file, or strips only Orca's entries from a mixed file.
  • Fix-up on top of feat(kiro): report V3 engine (--v3) status through a global standalone hooks file #24937:
    • The V3 file now follows KIRO_HOME (resolveKiroHomeDir(), or the probed remote KIRO_HOME) instead of always going to ~/.kiro. kiro-cli 2.31 changelog: "extends KIRO_HOME across V3 configuration and state".
    • With no custom agent, the status is partial rather than not_installed, because the V3 file does cover the default agent.
    • Dropped the unrelated resume and docs churn, shortened comments to repo style and trimmed the tests.

Why

kiro-cli Engine Hooks file location Fires?
2.29.0 --v3 $HOME/.kiro/hooks with KIRO_HOME=alt yes (SessionEnd)
2.29.0 --v3 $KIRO_HOME/hooks only no
2.34.0 --v3 $KIRO_HOME/hooks only yes (SessionEnd)
2.34.0 --v3 $HOME/.kiro/hooks with KIRO_HOME=alt no
2.34.0 default (V2), custom agent with hooks, plus the V3 file agent hooks only (userPromptSubmit) the V3 file does not fire, so no double report on V2

kiro-cli 2.34.0 (chat --help) describes --v2 as "the pre-3.0 default". The changelog for 2.30.0 says V3 "becomes the default with CLI 3.0 at the end of October".

Linked Issue

Fixes #31577
Refs #24177, #7693. These are covered once the pane runs V3. On the V2 engine, Kiro's built-in default agent still cannot carry hooks, and the status detail says so.

Visual Proof

N/A. This adds no UI. It feeds the existing agent status rows.

Testing

Review

Risk is low to medium.

  • The change writes one new file in the user's Kiro hooks dir. It never overwrites a file it didn't write.
  • On V3, a custom agent that still has Orca's agent-config hooks may also fire the global file. Kiro then reports each event twice. Both copies carry the same state, so the status is the same, just sent twice.
  • Remote (SSH) install writes the same file under the remote KIRO_HOME or ~/.kiro.
  • Windows uses the existing .cmd launcher command. That launcher was verified on Windows in feat(kiro): report V3 engine (--v3) status through a global standalone hooks file #24937 (2.27.1). This branch was not re-run on Windows.

Co-authored-by: LDH1103 ldh517525@gmail.com

LDH1103 and others added 8 commits October 3, 2026 12:17
…essions

kiro-cli 2.27 runs standalone hook files from ~/.kiro/hooks/*.json in its V3
engine and passes Claude-style events (SessionStart, UserPromptSubmit,
PreToolUse, PostToolUse, Stop, SessionEnd) with session_id/cwd/tool fields,
and the hook process inherits the PTY env. Orca now installs one Orca-owned
hooks file there (local and SSH) that runs the shared curl script, so Kiro
panes report working/done like the other hooked agents.

The events reuse the Claude-compatible lifecycle normalizer. SessionStart is
dropped because Kiro creates its session lazily right before the first
prompt. No synthetic title is added, so hookless (V2) Kiro keeps its current
tui-idle behavior.

The hook session_id is also recorded as Kiro's provider session, and Kiro
joins the resumable agents with `--resume-id`; kiro-cli reopens a session
with the engine and agent it was created under. The resume capability is
gated for older hosts like the other late additions.
- install() and installRemote() now leave a same-named
  ~/.kiro/hooks/orca-agent-status.json alone, and report an error, when it
  holds any hook that does not run Orca's script or cannot be parsed.
  Before, they rewrote the file whole.
- remove() deletes the file only when every hook in it runs Orca's script,
  so a file that mixes in someone else's hooks is kept.
- getStatus() reports `installed` only for entries Kiro would run: the file
  must be `version: "v1"`, and entries marked `enabled: false` do not count.
- The supported agents table now names Kiro's hooks/status/resume support
  and its V3 requirement.
# Conflicts:
#	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/renderer/src/runtime/agent-resume-host-authority-capability.ts
#	src/shared/agent-hook-listener/providers/compatible-lifecycle-events.ts
#	src/shared/agent-hook-listener/source-routing.ts
#	src/shared/agent-hook-relay.ts
#	src/shared/agent-hook-types.ts
#	src/shared/agent-session-resume.test.ts
#	src/shared/agent-session-resume.ts
#	src/shared/protocol-version.ts
Takes main's default-engine Kiro integration (#26695) for every file both
sides added: hook registry, remote installers, resume argv and capability,
and the /hook/kiro event routing. The V3 standalone hooks are re-applied on
top in the next commit.
… file

Kiro's opt-in V3 engine (--v3) refuses default-engine agent configs and
loads ~/.kiro/hooks/*.json instead, so the hooks #26695 installs into each
agent never fire there. Install one Orca-owned standalone hooks file next to
them, locally and over SSH, and normalize V3's PascalCase events on the same
/hook/kiro route.

- The file always lives under the home's .kiro, not KIRO_HOME: kiro-cli
  2.27.1 V3 ignores KIRO_HOME for both hooks and sessions.
- It is installed even with no custom agent, since V3 applies it to the
  built-in default agent too.
- A same-named file Orca did not write (other entries, unknown fields, a
  non-v1 version, unparsable JSON) is left untouched and reported as an
  error, matching the default-engine installer.
- SessionStart is ignored: V3 fires it lazily right before the first prompt.
…3-default-agent

# Conflicts:
#	config/tsconfig.cli.json
#	src/main/kiro/hook-service.ts
#	src/renderer/src/store/slices/agent-status-quit-capture-resumable-agents.test.ts
#	src/shared/agent-hook-listener/providers/kiro-events.ts
#	src/shared/agent-session-resume.test.ts
…ult-agent coverage

kiro-cli 2.31+ reads V3 global hooks from $KIRO_HOME/hooks (verified on
2.34.0; 2.29.0 still used ~/.kiro/hooks). With no custom agent, the V3 file
now reports partial instead of not_installed.

Co-authored-by: LDH1103 <ldh517525@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d501a790-cbd2-4e04-90f1-73837fc54046
Commits

Reviewing files that changed from the base of the PR and between 47ed6e1 and 52f7982.

Files selected for processing: 11
  • src/main/kiro/hook-service.test.ts
  • src/main/kiro/hook-service.ts
  • src/main/kiro/hook-settings.ts
  • src/main/kiro/standalone-hook-settings.ts
  • src/main/kiro/standalone-hooks-remote.test.ts
  • src/main/kiro/standalone-hooks.test.ts
  • src/main/kiro/standalone-hooks.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
  • Autofix · 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.

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.

Kiro status hooks are dropped when Kiro runs its V3 engine (--v3): PascalCase hook_event_name, and the default agent never gets hooks

2 participants