Repository navigation
fix(kiro): report status on Kiro's V3 engine, including the built-in default agent - #33660
Merged
Merged
Conversation
…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>
Contributor
|
Warning Review limit reachedYou'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. View limit details
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 |
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mainand trimmed. On top of that is one fix-up commit.What Changed
normalizeKiroEventnow accepts V3's PascalCase names.UserPromptSubmit/PreToolUse/PostToolUsemean working, andStop/SessionEndmean done.SessionStartis ignored because V3 fires it lazily, right before the first prompt. The camelCase V2 mapping is unchanged.KiroHookService.install()/installRemote()also writeorca-agent-status.json(Kiro'sversion: "v1"standalone format) into Kiro's global hooks dir. It runs the same managedkiro-hookscript. 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.KIRO_HOME(resolveKiroHomeDir(), or the probed remoteKIRO_HOME) instead of always going to~/.kiro. kiro-cli 2.31 changelog: "extendsKIRO_HOMEacross V3 configuration and state".partialrather thannot_installed, because the V3 file does cover the default agent.Why
agentSpawn→SessionStart,userPromptSubmit→UserPromptSubmit,preToolUse→PreToolUse,postToolUse→PostToolUse,stop→Stop. Payloads captured by the reporter on kiro-cli 2.33 (Kiro status hooks are dropped when Kiro runs its V3 engine (--v3): PascalCase hook_event_name, and the default agent never gets hooks #31577) match.kiro_default, which has no file to patch.KIRO_API_KEYso no model call can succeed:--v3$HOME/.kiro/hookswithKIRO_HOME=altSessionEnd)--v3$KIRO_HOME/hooksonly--v3$KIRO_HOME/hooksonlySessionEnd)--v3$HOME/.kiro/hookswithKIRO_HOME=altuserPromptSubmit)kiro-cli 2.34.0 (
chat --help) describes--v2as "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
I manually tested these changes locally
Automated tests added/updated
Real code path on macOS: ran
KiroHookService.install()against an empty tempHOME, which wrote the script and~/.kiro/hooks/orca-agent-status.jsonwith no custom agent. Then ran kiro-cli 2.34.0chat --v3 --no-interactivewith an env stripped ofORCA_*and pointed at a local capture server. The server receivedPOST /hook/kiro {"session_id":"sess_…","hook_event_name":"SessionEnd",…}. Onmainthere is no file, andSessionEnd/Stopwould map tonull.pnpm test src/main/kiro src/shared/agent-hook-listener src/main/agent-hookspasses.pnpm tcandcheck:code-quality:changedare clean.Not verified: a full V3 turn (
UserPromptSubmit/PreToolUse/Stop) needs a Kiro account. Those payload shapes come from Kiro status hooks are dropped when Kiro runs its V3 engine (--v3): PascalCase hook_event_name, and the default agent never gets hooks #31577 (2.33) and feat(kiro): report V3 engine (--v3) status through a global standalone hooks file #24937 (2.27, Windows).Review
Risk is low to medium.
KIRO_HOMEor~/.kiro..cmdlauncher 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