Repository navigation
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.
There was a problem hiding this comment.
ℹ️ No critical issues — one scope question and a doc nitpick.
Reviewed changes
This PR wires Kiro into Orca's managed-hook status and session-resume machinery, following the existing DSH/ZCode/Kimi pattern:
- Managed hooks for Kiro — new
src/main/kiro/hook-service.tsandhook-settings.tsinstall/remove an Orca-owned~/.kiro/hooks/orca-agent-status.json(Kiro v1 standalone format) plus the shared launcherkiro-hook.{sh,cmd}, and register it across the install/refresh/remove/status and remote (SSH/WSL) installer registries. - Event mapping —
/hook/kirorouting reusesnormalizeCompatibleLifecycleEventand the Claude tool-field extractor.SessionStartis dropped (Kiro creates its session lazily, right before the first prompt);UserPromptSubmit/tool events reportworking;Stop/SessionEndreportdone;isNewTurnEventisUserPromptSubmit. - Resume —
kirojoinsRESUMABLE_TUI_AGENTS,getAgentResumeArgvreturns['kiro-cli', '--resume-id', id](only the flag is appended, sincekiro-cli chat --tui ...already carries the subcommand), gated by the newagent-session.kiro-resume.v1capability. - Deliberately unchanged —
getTuiAgentRestSignal('kiro')staysnoneand no agent-state-rules file is added, so Kiro staysidentity-onlyin thetui-idlehook lane, avoiding the #24177 regression for hookless V2 Kiro.
I read the full diff and ran the touched suites locally (src/main/kiro, src/main/agent-hooks, plus the shared resume/startup/event tests): 1192 passed, 11 skipped, 0 failed. The implementation is consistent with the neighbouring agent services and the tests pin exact behavior (byte-identical idempotency, malformed-file error, foreign-file preservation, exact resume launch command). No correctness or security issue found.
ℹ️ Kiro hooks can install and report installed while never firing
install() writes the hooks file for every detected Kiro install, and the managed-hooks status reader reports it installed, but kiro-cli only loads ~/.kiro/hooks/*.json under the --v3 engine. The default launchCmd (kiro-cli chat --tui) therefore leaves status silent, so a user can see Kiro's hooks as installed in settings while no status row ever appears. The PR body flags this as a maintainer call — worth confirming whether the default Kiro launch command should carry --v3, or whether the settings/status surface should qualify Kiro as opt-in. Not blocking; the feature is correct whenever --v3 is configured.
ℹ️ Nitpicks
docs/site/content/docs/agents/supported.mdx:43still lists Kiro as plain "Auto-setup". Every other hook/status-capable agent names those capabilities in that column; adding a Kiro hook/status/resume note (with the--v3qualifier) would keep the table accurate.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
95b33768-06af-4541-b10a-8b6485d93708
📒 Files selected for processing (24)
config/tsconfig.cli.jsonsrc/main/agent-hooks/managed-agent-hook-registry.tssrc/main/agent-hooks/managed-hook-command-contract.test.tssrc/main/agent-hooks/remote-hook-service-registry-coverage.test.tssrc/main/agent-hooks/remote-managed-hook-installers.tssrc/main/agent-hooks/server-retired-pane-new-turn.test.tssrc/main/kiro/hook-service-remote.test.tssrc/main/kiro/hook-service.test.tssrc/main/kiro/hook-service.tssrc/main/kiro/hook-settings.tssrc/renderer/src/runtime/agent-resume-host-authority-capability.test.tssrc/renderer/src/runtime/agent-resume-host-authority-capability.tssrc/renderer/src/store/slices/agent-status-quit-capture-resumable-agents.test.tssrc/shared/agent-hook-listener/provider-dispatch.tssrc/shared/agent-hook-listener/provider-event-routing.tssrc/shared/agent-hook-listener/providers/compatible-lifecycle-events.tssrc/shared/agent-hook-listener/providers/kiro-events.test.tssrc/shared/agent-hook-listener/source-routing.tssrc/shared/agent-hook-relay.tssrc/shared/agent-hook-types.tssrc/shared/agent-session-resume.test.tssrc/shared/agent-session-resume.tssrc/shared/protocol-version.tssrc/shared/tui-agent-startup-kiro-resume.test.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.
- 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.
|
Thanks for the reviews. The three CodeRabbit findings are addressed in 1df7733. @pullfrog's notes:
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the delta since the prior pullfrog review (c1c5db7 → 1df7733), a hardening pass that keeps Orca's Kiro hook install from clobbering hooks someone else wrote:
- Foreign-file guard on install —
install()andinstallRemote()read the existing~/.kiro/hooks/orca-agent-status.jsonfirst and returnstate: error, writing nothing, when it holds any hook that does not run Orca's script or cannot be parsed, instead of rewriting it whole. - Conservative removal —
remove()unlinks the file only when every hook in it runs Orca's script, so a file that mixes in someone else's hooks is preserved. - Active-only status —
getStatus()counts only entries Kiro would run: the file must beversion: "v1", and entries markedenabled: falseno longer count, so a disabled or non-v1 file reportspartialrather thaninstalled. - Docs — the supported-agents table now names Kiro's hooks/status/resume support and its
--v3requirement. - Tests — new local and remote cases pin foreign-file refusal, unparseable-file refusal, mixed-file preservation, and disabled/non-v1 status.
I read the full incremental diff and the full PR diff, and ran the touched suites locally: 20 passed, 0 failed. The new tests exercise the exact pre-fix bugs (the old install() rewrote the file whole; the old remove() deleted on any managed entry), so they are real coverage rather than tautologies.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
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:
e89f37fb-7cfd-4908-aa00-3cb85314a106
📒 Files selected for processing (5)
docs/site/content/docs/agents/supported.mdxsrc/main/kiro/hook-service-remote.test.tssrc/main/kiro/hook-service.test.tssrc/main/kiro/hook-service.tssrc/main/kiro/hook-settings.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/main/kiro/hook-service-remote.test.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.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior Pullfrog review (c1c5db7c70): the fix commit 1df7733f47, which hardens Kiro hook-file ownership and status counting, plus the doc update. The three CodeRabbit ownership/status findings are all addressed.
- Ownership guard on install and remove —
install(),installRemote(), andremove()read the existingorca-agent-status.jsonfirst and only rewrite or delete it when every entry runs Orca's managed script, so a foreign or mixed same-named file is preserved and reported aserrorinstead of being clobbered. - Active-only status counting —
getStatus()now counts only entries Kiro would run (requiresversion: "v1"and skipsenabled: false), so a disabled or non-v1 hook set reportspartialrather thaninstalled. - Doc alignment — the supported-agents table names Kiro's hooks/status/resume and the
--v3requirement.
Verification on the branch: src/main/kiro plus the shared Kiro event/resume suites pass (22 tests), src/main/agent-hooks passes (1120 passed, 11 skipped), node typecheck is clean, oxlint is clean, and the changed-code quality gate reports 0 findings.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the delta since the prior Pullfrog review (1df7733 → 3bb5aa0): a single fix that makes KiroHookService.remove() clear Orca's hooks from a mixed file instead of leaving the whole file (and Orca's hooks) in place.
- Selective removal from a mixed file — when
~/.kiro/hooks/orca-agent-status.jsonholds Orca's hooks alongside hooks someone else added,remove()now rewrites it with only Orca's entries dropped (newremoveManagedKiroHooks) rather than leaving the file untouched, so an uninstall actually clears Orca's entries while keeping the user's. - Whole-file delete preserved for Orca-owned files — a file whose every hook runs Orca's script is still
unlinked, andremove()returns early for an unreadable file or one with no managed hooks. - Test rewritten — the mixed-file case now asserts the on-disk result is
{ version: 'v1', hooks: [userHook] }with statusnot_installed; the previous version asserted the mixed file survived verbatim.
I read the incremental range-diff and the full PR diff, and re-ran the Kiro plus shared resume/event suites: 68 passed, 0 failed. The rewritten test would fail against the pre-fix remove() (which never wrote a stripped file), so it is real coverage rather than a tautology.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
# 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
|
Thanks a lot for working on this! I use kiro-cli inside Orca and ran into the same problem, so this PR is very welcome. It would also help beyond the sidebar status: right now Kiro panes don't show up in the "Send notes to" menu (Markdown review notes / Annotate AI Diff), since that menu only lists panes with hook status or a recognized agent title. With the hook rows from this PR, Kiro should appear there too. A small thing I noticed while reading Happy to help test on macOS if that would be useful. |
|
Thanks @ryoupr, and thanks for reading "Send notes to": Yes. That menu builds its terminal targets from the hook status rows ( Stale after 30 minutes: Your reading matches mine. Once a hook row is older than macOS testing: That would be really helpful, since my testing so far has been on Windows. If you have time, on this branch with
|
|
Hi @LDH1103, I opened #26695 without having seen this PR or #24938, sorry about the overlap. The two seem to cover different Kiro engines. Yours uses the V3 standalone hooks in Both PRs add |
Takes main's default-engine Kiro integration (stablyai#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 stablyai#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.
|
I rebuilt this PR on top of #26695. Thanks @w-felipe360 for flagging the overlap, and @nwparker for sorting out the two engines in your review there. Everything both PRs added now comes from
Here is what I measured on kiro-cli 2.27.1. V3 rejects default-engine agent configs as "needs upgrading", so #26695's hooks never fire under #24938 got the same treatment for V3 session history. |
|
Thanks for rebuilding this on top of #26695! I tested the current head ( Setup
1. Sidebar status: working → done ✅ 2. "Send notes to" ✅
3. Quit and reopen
More details: hook probe, tests, and other notesHook probe outside Orca (kiro-cli 2.29.1)
Tests on macOS
Other notes
Screenshots:
|
|
Thanks so much, @ryoupr. This is exactly the coverage I couldn't get on Windows, and the screenshots make it easy to follow. A few notes on what you found:
It's also good to see your universal-format agent config left alone. That confirms the installer doesn't touch configs it doesn't support. Thanks again for taking the time to test all of this. |
…default agent (#33660) Kiro's V3 engine (default from Kiro CLI 3.0) now reports status in Orca: Orca installs a global hooks file under KIRO_HOME/hooks (covering the built-in default agent, local and remote, never overwriting user files) and recognizes V3's PascalCase hook events. Fixes #31577 Supersedes #24937 Co-authored-by: Dongho Lee <[email protected]>






ELI5
#26695 made Kiro panes report working/done on Kiro's default engine by adding Orca's hooks to each custom agent config. Kiro's opt-in V3 engine (
kiro-cli chat --v3) doesn't load those configs. It rejects them as "needs upgrading" and falls back to its built-in agent, and it only runs hooks from standalone~/.kiro/hooks/*.jsonfiles. So a V3 pane still shows no status. This PR keeps #26695's default-engine integration as is and adds one Orca-owned standalone hooks file for V3.This PR was rebuilt on top of #26695. Everything both PRs added (hook registry, resume argv and capability,
/hook/kirorouting) now comes frommainunchanged. What's left is V3 only.What Changed
Before (on
main): with--v3, a Kiro pane gets no status row. V3 never runs the agent-config hooks, and the PascalCase events it sends would be dropped bynormalizeKiroEvent.After: V3 panes go
workingon a prompt or tool anddoneon stop, with the providersess_id recorded for resume. The default engine behaves exactly as before.Mechanism:
src/main/kiro/standalone-hook-settings.ts,src/main/kiro/standalone-hooks.ts(new): build, install, remove and report~/.kiro/hooks/orca-agent-status.json(Kiro's v1 standalone format).SessionStart,UserPromptSubmit,PreToolUse,PostToolUse,Stop,SessionEnd) run the same managedkiro-hookscript and command (getKiroManagedCommand) that feat(kiro): report Kiro agent status and list Kiro sessions in history #26695 uses.version: "v1", a non-emptyhooksarray whose every entry runs Orca's script, and no other fields. Anything else (user entries, unknown fields, another version, unparsable JSON) is left untouched and reported as an error, following feat(kiro): report Kiro agent status and list Kiro sessions in history #26695's rule for unsupported agent configs.remove()deletes the file when it is all Orca's, and strips only Orca's entries from a mixed file.KiroHookService(hook-service.ts) calls into the new module:install()/installRemote()write the script first, then the V3 file, then the agent configs as before. The V3 file goes in even with zero custom agents, since V3 applies it to the built-in default agent too.remove()clears both.getStatus()keeps the agent-config status as the primary state. A V3 file error is appended to the detail and lowersinstalledtopartial.kiro-events.ts,kiro-tool-fields.ts,provider-event-routing.ts: V3 sends Claude's PascalCase names.UserPromptSubmit/PreToolUse/PostToolUsemap to working, andStop/SessionEndmap to done.SessionStartis ignored: V3 fires it lazily, right before the first prompt.UserPromptSubmitis a new-turn boundary.Why
Probed with kiro-cli 2.27.1 on Windows 11. Each hook logged its stdin.
--v2, agent config with embedded hooks, plus a standalone fileuserPromptSubmit,stop). The standalone file never runs, so there is no double report.--v3, the same default-engine agent configagent "…" needs upgrading for this agent engine, using "default". No agent-config hook fires.--v3,KIRO_HOMEpointed at a temp dir$KIRO_HOME/hooksdon't fire, and the session is written to the real~/.kiro/sessions/. V3 ignoresKIRO_HOME, so the V3 file goes under the home's.kiro, unlike #26695'sKIRO_HOME-aware agents dir.--v3, default agent, standalone file using Orca's encoded PowerShell launcherSessionStart,UserPromptSubmitandStoparrive with thesess_…id on stdin.Resume needs no change.
getAgentResumeArgv('kiro')already appends--resume-id <id>, and kiro-cli reopens asess_id on the V3 engine and agent it was created with (verified on 2.27.0 in the previous revision of this PR).Linked Issue
Refs #24177. #26695 covers the default engine; this adds
--v3.Visual Proof
N/A, no UI changes. The status rows are the same ones #26695 drives.
Hook firing for the rebuilt version is in the table above. The previous revision of this PR was run end to end in a
pnpm devbuild with--v3:orca-dev worktree psshowed working → done, and the pane resumed after a crash.Testing
Automated (Windows 11):
src/main/kiro/standalone-hooks.test.ts(21) andstandalone-hooks-remote.test.ts(3):PromptSubmit,AgentStop) not registeredKIRO_HOMEis setremove()clearing both fileskiro-events.test.ts: V3 payloads captured from kiro-cli 2.27, including a stringtool_response. Unknown and doc-only names map tonull. The onemainexpectation this changes on purpose isStop, which used to map tonull.agent-session-resume.test.ts,tui-agent-startup-kiro-resume.test.ts, quit-capture:sess_ids and a--v3 --agentcommand override.hook-servicesuite.src/main/agent-hooksandsrc/shared/agent-hook-listener: 1,925 passed, 8 failed. All 8 fail locally on Windows because/bin/sh, Git Bash and tmux are unavailable. They are inhook-script-outside-orca,installer-utils,local-tmux-managed-ptyandspool, andsrc/main/agent-hooksis identical tomain.run-typecheck-projects-in-parallelexit 0.oxlint(with max-lines), anti-slop, code-quality (native and type-aware), the max-lines ratchet and reliability gates all pass.Not live-tested: macOS, Linux and SSH, and kiro-cli 2.28+ (#26695 was validated on 2.29).
AI Disclosure
Implemented with Claude Opus 5.5 (Anthropic) through Claude Code, directed and reviewed by me. The kiro-cli behavior above was measured on a real install, not taken from docs.
Review
.shcommand. SSH always writes POSIX, to<remote home>/.kiro/hooks/.Known limits:
kiro-cli agent upgradeon agents that already carry Orca's hooks, the universal format keeps those hooks and V3 runs them too, so each event posts twice. The states are identical; repeateddonedoesn't re-notify, but a secondUserPromptSubmitrestarts the turn timer.main's installer reports such array-formhooksas unsupported and leaves them alone.working.Stophas no final assistant text.Output:/Exit Code: 0block to the prompt for eachUserPromptSubmitcommand hook, even when the hook prints nothing. Harmless, but the model sometimes mentions it (seen on kiro-cli 2.29.1).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
Companion PR #24938 was rebuilt the same way: it adds V3's session store to the Kiro history #26695 introduced.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)