Repository navigation
Record Kiro Crew sessions and nest their sub-agents - #1149
Conversation
Crew rebuilds its agent profiles at every gateway start and keeps only ~/.kiro/hooks/*.sh, so kcap.json's hook never reaches a Crew session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crew records the child's session id about a second after its first prompt, and a one-prompt sub-agent fires agentSpawn only once, so the hook waits briefly for any session Crew has not mapped to a chat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Summary by QodoCapture Kiro Crew sessions and nest sub-agents
AI Description
Diagram
High-Level Assessment
Files changed (21)
|
Code Review by Qodo
1.
|
A marker beside the script tells a Crew installed since kcap from a hook the user deleted, which the npm-upgrade refresh must not bring back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A chat can move to a new Kiro session after spawning a child, so the parent is the newest mapped session created before the child started. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crew delivers each child's result to the parent as a new prompt, so the parent's hook links a one-prompt child recorded before the parent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assigning strings into a JsonArray throws in the published binary even though it compiles and passes unit tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crew sets KIROCREW_SPAWNED on every kiro-cli it runs; without that gate a plain Kiro session paid the wait on every prompt once Crew was installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No GitHub issue — AI-3189 · AI-3190 · AI-3191
What & why
Kiro Crew runs the installed
kiro-cliunder agent profiles it regenerates at every start, keeping only~/.kiro/hooks/*.shas user hooks and reading skills only from~/.kiro/crew/skills, so no Crew session reached Capacitor. When Crew is present,kcap setupandkcap plugin install --kironow write an executable~/.kiro/hooks/kcap-spawn.shwrappingkcap hook --kiro, and copy kcap's skills into Crew's skills root;plugin remove --kiroundoes both. The Kiro hook andkcap import --kiroalso send each session's Crew parent and children, joined from Crew's sub-agent records, session map and each Kiro session's creation time, so the server can nest sub-agents (server half: kurrent-io/kcap-server#2056).Where to look
Crew writes a sub-agent's session id about a second after its first prompt, so the hook waits up to 1.5 s for it, but only when
KIROCREW_SPAWNED=1(Crew sets it on everykiro-cliit launches). A plain Kiro session never waits. A hook script kcap did not write is never overwritten or deleted, and the upgrade-time refresh never restores a hook or skills the user deleted.Verification
agentSpawnhook, and a chat and its sub-agent each appeared in Capacitor.subagent_session_idsnaming its child, and the child's hook sentparent_session_id.kcapand with a hostile install directory, which is not executed;🤖 Generated with Claude Code