Skip to content

feat(kiro): group subagent activity into Work-log entries#2

Merged
hrishikeshmane merged 1 commit into
kiro-acpfrom
kiro-subagent-grouping
Apr 21, 2026
Merged

feat(kiro): group subagent activity into Work-log entries#2
hrishikeshmane merged 1 commit into
kiro-acpfrom
kiro-subagent-grouping

Conversation

@hrishikeshmane
Copy link
Copy Markdown
Owner

@hrishikeshmane hrishikeshmane commented Apr 21, 2026

Summary

  • Translate Kiro's _kiro.dev/subagent/list_update roster transitions into task.started / task.completed envelopes, so subagent crews render as collapsible Work-log groups instead of flooding the main chat.
  • Emit task.progress per distinct subagent toolCallId with "{title}: {detail}" labels (e.g. Read file: src/foo.ts, Ran command: bun test) so the group shows live per-tool activity while the crew is running.
  • Thread sessionId through AcpParsedSessionEvent / AcpSessionRuntime so subagent session/update events can be dropped from the main thread — matching Claude Code's native SDK behavior of hiding subagent internals behind task notifications.
  • PATCH.md updated: new row for AcpRuntimeModel.ts in the integration-points and conflict-zones tables, bumped AcpSessionRuntime row, user-facing feature bullet, and a round-3 session reflection.

Test plan

  • bun run typecheck — clean
  • bun run vitest run on KiroAdapter.parsing.test.ts + AcpRuntimeModel.test.ts — 40 tests pass (18 new: 10 roster parsing + diff semantics, 8 formatSubagentToolLabel)
  • Manual smoke (web): pair, enable Kiro, verify model list + TraitsPicker populate (20 agents), / slash menu shows built-ins.
  • Run a subagent-spawning prompt against Kiro and verify Work-log group renders with live per-tool rows labeled Title: detail

Kiro multiplexes `session/update` for the main session and every
spawned subagent crew over one ACP channel, each tagged with its
originating sessionId. Previously every subagent tool call, assistant
message, and content delta landed on the main chat as flat inline
rows — the "chaotic" UX relative to Claude Code's native Work-log
grouping.

Match Claude Code's behavior: subagent work appears as a collapsible
Work-log group with live per-tool activity inside, and the main
thread stays clean.

- Thread `sessionId` through every `AcpParsedSessionEvent` variant and
  through `AcpAssistantSegmentState` in `AcpSessionRuntime`, so
  KiroAdapter can tell main-session events apart from subagent events.
- Track in-flight subagents in `KiroSessionContext.subagentTasks`,
  keyed by ACP sessionId, and translate `_kiro.dev/subagent/list_update`
  roster transitions into `task.started` / `task.completed` envelopes.
  On session teardown, flush dangling tasks as `status: "stopped"` so
  the Work-log spinner doesn't hang.
- Emit one `task.progress` per distinct subagent `toolCallId` (tracked
  per-subagent in `seenToolCallIds`) so the Work-log shows live
  activity inside the group while the crew is running, instead of
  sitting silent between start and end markers.
- Format each progress row as `"{title}: {detail}"` via a new exported
  `formatSubagentToolLabel` helper so rows read "Read file: src/foo.ts"
  or "Ran command: bun test" instead of the bare category.
- Drop subagent ContentDelta / AssistantItem / PlanUpdated / ModeChanged
  events from the main thread — they're subagent internals the user
  shouldn't see.

The UI needs no changes — `deriveWorkLogEntries` already groups
task.progress/task.completed under a collapsible Work-log widget.

PATCH.md updated: new integration-points row for AcpRuntimeModel,
bumped AcpSessionRuntime row, added a user-facing feature bullet, new
row in the conflict-zones table, and a session-reflection entry.

Tests: 18 new cases — 10 around roster parsing + diff semantics
(missing sessionId, unknown status, started/completed emission,
idempotence on re-sends, implicit termination on disappearance) and
8 on `formatSubagentToolLabel` (title+detail combining, command
fallback, title-only, detail-only, identical dedup, kind fallback,
empty "Working" fallback, whitespace trimming).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 21, 2026
@hrishikeshmane hrishikeshmane merged commit 6e1d670 into kiro-acp Apr 21, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant