Skip to content

fix(chat): show a native sub-agent's work live on its card - #20034

Open
hickoxd wants to merge 2 commits into
kirodotdev:mainfrom
hickoxd:fix/subagent-card-live-transcript
Open

hickoxd wants to merge 2 commits into
kirodotdev:mainfrom
hickoxd:fix/subagent-card-live-transcript

Conversation

@hickoxd

@hickoxd hickoxd commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A sub-agent's card says what the child is doing while it runs — its reasoning, each tool call with input and output, and its answer — instead of "Starting…" over "Waiting for output…" until the run ends.

A sub-agent spawned with kiro-cli's native subagent tool reads "Starting…" in the Subagents panel for its entire run; its Output box says "Waiting for output…", and the card changes only when the child finishes.

Why it matters

The panel is the only place the dashboard shows a native child. Frozen on "Starting…", it cannot tell a working child from a stuck one, or show what it found, short of waiting or cancelling.

Not a goal

What changed (motivation → approach → change)

Symptom. The card never leaves "Starting…"; its Output box never fills.

Root cause, from the frames kiro-cli 2.31 emits. (1) kiro-cli sends everything the child does as session/update frames tagged with the child's session id; the handle re-tagged only tool calls and text, dropping results and reasoning; the runner's activity arm only filled a toolCallId→card map for parent-tagged copies kiro-cli never sends. (2) The card's label read "no streamed answer text" as "not started".

Change.

  • Backend: the handle re-tags the child's refinements, results and reasoning too (AcpEvent.activity). _native_subagent_activity (chat_turn/native_cards.py) projects them onto the card — subagent_tool (title, id, count, bounded input), subagent_tool_result (redacted, bounded output from the terminal frame, status alone before it), subagent_thinking, subagent_chunk — bounds, admission and feed append in dashboard/native_subagent_cards.py (new). Per-child rolling redactors keep a split credential off the wire; a call is admitted on its first frame of any shape, so a result-first call cannot abort the turn.
  • Frontend: a per-card transcript (reasoning/tool/text rows, stable seq keys, 200-row cap) replaces the toolCalls list; SubagentTranscript replaces the Output box once the card has rows. A failed call opens on ErrorNotice with the hand-off. "Starting…" is reserved for a card nothing has been heard from. A finished card's result folds behind "Full result" (a managed card's disk-loaded result stays open).
  • Docs: docs/system-specs/modules/subagent.md; the feature map. Inventory under Change details.

Backwards compatibility

Compatible: nothing main accepts is rejected, renamed or removed. The two WS events are additive, in the subagent scope; subagent_tool gains one optional field (input) consumers ignore. An older dashboard drops the unknown frames; a newer one on an older gateway never sees them. Reasoning and text arrive as the parent's do: a chunk's trailing credential-class run is held until a terminator, the child's next output of another kind, or its end.

Client-side removals, no wire change — each reader and its holding test:

  • Reader: website/src/pages/chat/ActivityViewer.tsx:SubagentToolCalls -- subagent -- the "Tool calls" list and its box are deleted; rows render from SubagentTranscript (SubagentTranscript.toolRows.test.tsx keeps the Subagents panel: show tool-call timeline and token/cost for each run #13628 rules)
  • Reader: website/src/store/chat/subagents.ts:SUBAGENT_TOOL_CALLS_CAP -- subagent -- removed with its only readers recordToolCall and toolCalls; chatSlice.publicSurface.test.ts pins the surface
  • Reader: src/kiro_crew/messaging/driver.py:EVENT_SUBAGENT_ACTIVITY -- chat -- its isolation gate reads only the event kind and tool_call_id, both unchanged (test_driver_session_directives.py::test_native_subagent_directive_is_refused)

Review notes

  • GPT 6.1 (all taken): one admission and one constant pair bound every store keyed on a child's call id (a refused call holds no row, is counted, ends no segment; the bound is said once per snapshot); only a terminal status is a failure; output prints from the terminal frame through one rolling redactor per call, both paths; repeats dedup by content; a result frame lands buffered reasoning before a result-first row opens.
  • UX (taken): a failed row is muted while the card runs or COMPLETED, red only if the card failed; a folded "Thought process" row previews its first line; circled-X throughout; "Full result" at the rows' weight, named on a finished managed card's open box too; "Unnamed tool call" for a pending name, "→ Tool call past the name limit" in the feed (labelling a live row as past the bound needs a past-bound count on the wire: follow-up Subagents panel: label live rows past the tool-call name bound, and lead the Full result feed with the overflow note #31651); the row's hand-off shares the card's verb; a tool row's toggle is named by its call (no shared aria-label); the status-alone line states only what is missing; the finished card's "Last tool" line drops Running: as the rows do. Kept: the hand-off on an opened failed row while the card runs — errors-use-error-notice (blocking) puts askAgent ON for a status panel with no draft (GPT blocked rev 5); no muted register; "main agent" would misname it (the hand-off opens a fresh chat, as every "Ask the agent" does); "Ask in a new chat…" is the label rev 25 rejected as a second name; completed checks stay green, the Activity list's own done glyph. Evidence: previews 2/4/10/21; muted 15/25; failure 22; past the bound 18–20; hand-off 7/13/14/24.
  • First Principles: the bound stays — GPT's blocking a-bound-bounds-every-field-it-retains asked for it taken: the close-time log; and (rev 34) the second gate: _native_owned, its turn flag, the past-bound note and native_call_bound are deleted — upstream's _native_child_tc (feat(acp): show claude code subagents as native activity cards #23773) takes every child-tagged call id before admission, so tc_card ⊆ _native_child_tc and the arm could only refuse the parent's own directives; an untracked child's refusal no longer reads as a truncation (two tests, proven on rev 33). Kept: the overflow line (once per snapshot, per the rule); the fold (UX BLOCK, rev 2: transcript and box repeated); per-content dedup (per-id = the data loss GPT blocked); the flat-copy arms — the copying wire is the base's own (Six session-identity tools are dead on a default install (monitor_start, ask_question, suggest_followup, ...) #755, _native_tc_card, pinned by a base test); deleting them reopens a fenced GPT block (rev 12); tool_calls_not_listed keeps its reader.
  • Design: activity dropped by the provider copy: taken — _to_llm_event forwards it (test pinned). Projection: chat_turn/native_cards.py. Bound on a copying wire: the gate is upstream's _native_child_tc alone (First Principles, rev 34); a wire that drops the tag routes those frames as the parent's own (upstream's pre-PR path). Child-activity redactor (client_turn.py): upstream's, untouched; the card's are per stream. Cancel/crash: _native_subagent_close_all flushes open tails at the turn's release and in _on_complete. Scope: the subagent scope already carried titles and text; reasoning, inputs and results ride the same scope list and redactors. event.text: reasoning is told from text by activity alone; the one outside reader (messaging/driver.py) reads tool_call_id only.
  • File line cap (rev 43, out in rev 50): the stop_reasons.py split is reverted; main trimmed types.py (1,952 merged, under the cap), so it rode along on nothing (First Principles).
  • Opus (all taken): README nits; a flat tool_call refines the admitted call, no second → line; a child's refused directive result reaches its card marker-stripped, with the not-applied note; a finished managed card with rows keeps its box open for the disk loader; the follow effect keys on the newest row's seq; the count stops moving at the cap; rev 34: the past-bound arm, note and reason are gone (First Principles).
  • Rebase, rev 51 (main at d96e97a95b; feat: show the claude-agent-acp surfaces the dashboard drops #37512 and feat(security): one redaction switch, rule table only, value-only masks #37408 land on this change's files): main's _native_card_result reads the row's own result through this change's three-argument feed; a card main keeps open past the turn (kept_open) is skipped by _native_subagent_close_all with its record whole; main's new _close_lost_background caller passes the two maps this change made required (card_output_len={}, streams=None — no turn's redactors exist when the client reports the loss), and its six new _native_subagent_close_all test calls pass them too; the is_update refinement rule is carried into recordTranscriptTool (Tests); the stream tests plant a synthetic credential, since the rule table keeps an AWS key id visible.

Change details

Backend (session_handle_updates.py, types.py, chat_runner.py + chat_turn/{tool_rows,tool_results,turn_entry,turn_locals,turn_stats}.py, chat_turn/native_cards.py, state.py + state_parts/slot_directory.py, new dashboard/native_subagent_cards.py, ws_event_scope.py, providers/acp_turns.py)

  • AcpEvent.activity plus SUBAGENT_ACTIVITY_THINKING / SUBAGENT_ACTIVITY_TOOL_RESULT tell the re-tagged shapes apart. The handle re-tags the child's tool refinements (title, kind, purpose, input), results (the parser's redacted, bounded output plus terminal status) and thinking chunks — still never as parent transcript.
  • _native_subagent_activity projects each onto the card: subagent_tool {tool, tool_call_id, tool_count, input?} (a refinement for the same id refines the row; the count moves once per call; the card draws nothing from a call's kind, so the frame carries none), subagent_tool_result {tool_call_id, output?, status?} (output once per call — kiro-cli's duplicate terminal frame carries the status alone — and the output also joins the done-time result feed under the call's title, with kiro-cli's Running: status word stripped the way the rows strip it), subagent_thinking {text}, and subagent_chunk as before. Every string is redacted at the boundary; input and output are bounded. Reasoning and text go through per-child StreamRedactors: a chunk's trailing credential-class run is withheld until a terminator, the child's own next output of another kind (text after reasoning, reasoning after text, a new call's first frame), or the child's end (_close_native_card_streams runs before the done-time feed is built, so the text tail is part of the result). A tool's result or a title refinement of a known call is the host reporting on that call, not the child moving on, and ends no segment. Every store keyed on a child's call id — the turn's call-to-card attribution map, each card's call titles, the record of outputs already printed — is bounded by one admission (_admit_native_call) and one constant pair (NATIVE_SUBAGENT_CALLS_MAX = 1024 calls per turn, NATIVE_SUBAGENT_CALL_ID_CHARS = 128): a refused call gets no row anywhere, each of its frames is counted in calls_refused, the card's count stays where the bound left it, its output is filed under NATIVE_SUBAGENT_UNNAMED_FEED_LINE ("→ Tool call past the name limit" — worded apart from the client's "Unnamed tool call", which is a live row whose name has not arrived yet), and a run that crossed the bound says so once per snapshot: the running snapshot's streaming tail (NATIVE_SUBAGENT_CALLS_OVERFLOW_FEED_LINE is defined beside its sibling bounds in state_parts/slot_directory.py and read through the state facade, which builds the snapshots) and the finished result each end with that line. A refused call's frames end no redactor segment — only an admitted new call does — since each of them looks like a first frame. A call past the bound is still the child's: upstream's _native_child_tc (feat(acp): show claude code subagents as native activity cards #23773) records every child call id off the child-tagged frame before admission, so the directive gate refuses a refused, closed or untracked child's flat copy with the ordinary not-applied note and no audit error, and an id that never arrived child-tagged is the parent's, bound or no bound. A call's output prints from its terminal frame, which carries the whole of it; a frame in progress carries its status alone — a fragment broadcast on its own is redacted on its own, and a credential split across two fragments would cross the wire in halves — and its text is fed, in order, to one rolling StreamRedactor per admitted call (beside the child's reasoning and text redactors), whose committed output accumulates — bounded to the output's cap — as the call's pending text; that prints, plus the redactor's flush, if the terminal frame carries no text or at the child's close if no terminal frame comes, so a bearer header whose prefix and token arrived in separate frames is redacted whole (a refused call keeps nothing). A repeated terminal frame prints nothing again (_native_output_is_new, by content), so a terminal output that differs from the last printed one still prints. The maps are dropped with the redactors when the child ends, so the terminal record kept for reconnect replay carries only bounded fields. The turn-end safety net _native_subagent_close_all (called from the turn's release and from _on_complete, with upstream's error= for a turn cut short) flushes each still-open child's tails the same way before its result is built and takes the stream and output-length maps as required keyword-only arguments; a record the stop path already marked done only sheds its transients there. The toolCallId→card map is filled before the projection is gated on the child's record, so the flat tool_call/tool_result arms still see a call from a child the roster already closed, or one that never got a card, as the child's (its session-bound directive is refused by _native_child_tc either way). A parent-tagged result of an attributed call is handed to the same result projection as the child-tagged frame (_native_subagent_flat_result → _native_project_result): the terminal rule and the per-call rolling redactor, one result row instead of a chunk per fragment. A result carrying a session-directive marker is a session-bound tool the child called, which is never applied (the gate refuses the flat copy; the child-tagged frame never reaches it), so the card prints it as the runner prints the parent's own row for a refused one — marker stripped, the not-applied note in its place (_native_unapplied_directive_text, on both routes and on the fragments printed at the child's close); before, the card took the frame's raw output and read as if the refused directive had taken effect. A parent-tagged tool_call of an attributed call is a refinement of the call the activity frame admitted — the child channel announces the bare tool name, the copy carries the command-bearing title — so _native_subagent_flat_call refines the kept title slot and re-sends the subagent_tool frame with the count where admission left it, and writes no feed line: the result row names the call in the feed once, under the refined title (before, the arm wrote its own → title line and the result row wrote another).
  • _admit_native_call: a call is admitted, counted and its title slot decided on its first frame of any shape. kiro-cli's parser emits a terminal tool_call_update as a result event and then a refinement, and a child's opening tool_call is dropped when it arrives before the roster has admitted the child, so such a call is first seen through its result. Admitting there keeps the counter and the bounds ahead of every read, and a result-first call ends no redactor segment. A closed child's late call is still attributed, and a refusal of it is still counted on its record — the directive gate reads refusals off every record, and a record leaves the tracker only when the turn ends — while the finished record takes no title and no count of calls.
  • dashboard/native_subagent_cards.py (bounds, admission, output dedup) holds no state, calls no redactor and never imports the runner or the owner; the tests patch its bounds there. The projection, the per-child and per-call redactors, their flushes and the close live in chat_turn/native_cards.py, which reads the backend's event tags and the redactors through the runner's namespace the way every composed owner does.

Frontend (store/chat/subagents.ts, types/index.chat.ts and its types/index.ts re-export, hooks/useWebSocket.ts, pages/chat/ActivityViewer.tsx, new pages/chat/SubagentTranscript.tsx, app-sdk/index.ts)

  • SubagentActivity.transcript: reasoning / tool / text rows in arrival order, each carrying a seq one past every row's when it was created — the React key, stable while the cap drops rows off the front, and unique when a late refinement places a row before the newest (rev 51). A result for a call this browser never saw open claims only the one id-less row a reconnect snapshot seeded for the call in flight (seeded, cleared when a frame names the row); otherwise it opens an untitled row under the call's id ("Tool call" until the refinement names it). The roster re-sends a status message as an id-less subagent_tool frame too, and that row is never claimed (Opus, rev 50). A reconnect's replayed snapshot keeps a held card's rows and records the snapshot's latest tool onto them by the live rule (the row naming it is refined, a call the disconnect hid is appended); a replay that repeats what the card shows keeps the held rows. The text a disconnect hid is not recovered into the rows: the snapshot's feed has no row structure to land it in, and the card keeps no copy of the gateway's feed to diff it against (revs 39 to 48 did, and every reconnect finding since was the two copies drifting; Subagents panel: label live rows past the tool-call name bound, and lead the Full result feed with the overflow note #31651 tracks a structured snapshot that would carry rows). A card the replay creates seeds its call row under the snapshot's last_tool_call_id (id-less from an older gateway). Consecutive chunks of one kind merge; a tool row is keyed on its tool_call_id so its refinement and result land on it; capped at 200 rows with an omitted count. recordTranscriptTool keeps the old list's rules (same id or unmoved tool_count refines the row; a native roster re-send of the same title is not listed again — including the id-less re-send of a call the child announced by id), and the coalescer's "N earlier calls not shown" count moves to the transcript heading. A card rebuilt from a snapshot seeds its transcript from the snapshot's feed and latest tool, so a reload no longer hides what the agent did before it. New reducer sseSubagentToolResult; sseSubagentBatchUpdate reads only the fields the coalescer forwards.
  • The WS hook routes subagent_thinking through the same rAF-coalesced buffer as subagent_chunk (bufferSubagentChunk(…, 'thinking'), landed by sseSubagentBatchChunks with a kind): one store update per flush, a kind change lands the previous run first, and a tool frame flushes the buffer — so does a result frame, since a result for a call with no row yet opens one, and a row opened ahead of the buffered reasoning would sit above the words that preceded it.
  • SubagentTranscript: folded reasoning rows ("Thinking…" while live, "Thought process" after), tool rows that drop the Running: prefix, carry aria-current while live, and open on their input and output with a running / completed / failed mark (a failure is a terminal failed / cancelled / refused; a result carrying kiro-cli's non-terminal in_progress keeps the row live; a failed row's colour follows the card — muted while it runs, since it is usually an ordinary non-zero exit the agent is handling, and still muted once the card has COMPLETED, since the agent finished with it handled; red only when the card ended in failure or was stopped; the glyph is a circled X in every state), and markdown answer text. A folded reasoning row carries a truncated first line of its reasoning beside the label (content, aria-hidden, gone when the row opens), so several folded rows can be told apart without opening each. Its scroller follows the newest row unless the reader scrolled up, keyed on that row's seq (the row count stops moving at the cap), and fades whichever edges rows sit beyond. A failed call — with output, or by status alone — opens on ErrorNotice (title "Tool call failed"; the raw output as the scrolling mono message, or "No output was returned." when the terminal frame carried none — the title already says the call failed; the hand-off on under "Ask the agent about this failed call" — the verb of the card's own error notice, scoped to the call as askAgentLabel asks of two notices on one screen); a completed call keeps the plain Output box. The three disclosures are the shared Btn styled as text-link toggles. The heading reads "Live activity" while the card can still grow and "Activity" once finished; on a finished card the Output box comes back for the result below the rows, folded behind an aria-expanded "Full result" toggle at the tool rows' weight and case, since the rows already carry every tool output and the answer. A finished managed card whose result is not in state keeps that box open — it holds the disk loader the chip's one-click selection mounts, and folding it had left that click opening the card with nothing fetched until a second click on the toggle — and heads it "Full result" too (a static heading, no toggle) rather than a second "Output", since it is the same block the native card folds.
  • Seven new i18n keys (live_activity, full_result, tool_call_failed, tool_call_failed_no_output, ask_agent_about_failed_call, untitled_call — "Unnamed tool call", transcript_steps_not_listed_one/_other) in all 12 catalogs plus the pseudolocale; the plural key is registered in pluralKeys.json. The now-unreferenced "Tool calls" heading key is removed from every catalog.

Tests

Backend

  • test/test_native_subagent_live_transcript.py (58 tests, new) replays the recorded kiro-cli 2.31 child frame shapes through the handle and the projection: re-tagging of calls, results, thinking and text (never as parent transcript); one subagent_tool frame per call with the count moving once; one result frame per call, output and terminal status together, the content-only frame projecting nothing; bounds and redaction on input and output; thinking in its own frame and out of the feed; the done result carrying the feed. Streams: a 40-character credential of a real shape (built by kiro_crew.testing.synthetic_credentials; rev 51 — main's rule-table-only redactor, feat(security): one redaction switch, rule table only, value-only masks #37408, keeps an AWS key id visible, which the earlier fixture was) split across two reasoning chunks or two text chunks never crosses whole — against the first projection both fail: the joined wire carries the whole value; a result or a refinement between the two halves ends no segment (same symptom on the earlier code); a withheld tail is flushed when the child moves on and at the child's end (the turn-end close previously lost it: done.result == 'Final '). Bounds: one admission bounds every store keyed on a call's id — past NATIVE_SUBAGENT_CALLS_MAX a call holds no row in the attribution map, the titles or the printed-output record, the count stays where the bound left it and the refused frames are counted (against the previous revision the attribution map outgrew the bound: assert 259 == 256); an over-long id is refused everywhere; a closed child's refused call is counted on its record while the record takes no title and no count (against the previous revision: KeyError: 'calls_refused'); a refinement of a kept title does not count against the bound; an admitted call counts once however many frames it sends; a run under the bound counts no refusal and says nothing; a refused call's frames end no redactor segment (against the previous revision the halves reassembled on the wire); a running snapshot ends with the overflow line once, as the result does (previously assert 0 == 1); the terminal record and both snapshot shapes carry no per-run title state. Outputs: a call's output prints once, from its terminal frame, and a repeat prints nothing again; no fragment crosses the wire on its own — against the previous revision the half-key fragment went out: assert ['key AKIAIOSFOD…', 'EXAMPLE ok\n', …] == [None, None]; a terminal frame without text prints the call's fragments in order; a child's close flushes the fragments of calls that never ended and the terminal record keeps none; a refused call keeps no fragment and its terminal output prints whole under the unnamed line (all four against the revision before last); a bearer header split across fragments is redacted whole on both fallback paths — against the previous revision the close published the bare token: 'a1b2c3d4e5f6…' is contained here. Feed: an output whose call name the bound did not keep is filed under the unnamed line — against the previous projection it fails with the unnamed line missing ('→ step 0\nfirst\n\nlate\n\n'), the output filed under nothing — while a kept call announced untitled is filed under its output alone; the feed's line and the client's pending-name label are two wordings, and the overflow line names the feed's — against the previous constants: assert 'Unnamed tool call' != 'Unnamed tool call'. Result-first calls: admitted on the result and titled by the refinement, counted once, feed-joined, bound-honouring, segment-neutral — against the earlier projection the first aborts with KeyError: 'tool_count'. Directives: a child's directive result prints without its marker and with the not-applied note, in the frame and in the feed — against the previous revision the card output was armed\n[[KIROCREW_SESSION_DIRECTIVE]]{"kind":"monitor_start",…}.
  • test/test_dashboard_chat_segments.py::TestRunChatNativeSubagentAttribution::test_child_tagged_frames_alone_drive_the_card drives _run_chat end to end with only child-tagged frames. Against the original runner it fails with assert [] == ['shell', 'Running: git log -1']: no tool frame was ever broadcast, which is the "Starting…" symptom. ::test_a_flat_copy_of_a_childs_call_names_its_one_result_row (new) sends the child's activity frame, then the parent-tagged copy with the full title, then the result: the finished feed names the call once, under the refined title, and the copy arrives as a second subagent_tool frame for the same id with the count unmoved — against the previous runner: assert 2 == 1 on '→ Reading foo.py:1\n→ read\nfile body XYZ\n', the call named twice and its output filed under the stale bare name. ::test_native_tool_calls_attribute_dedupe_and_accumulate adapted to the same shape.
  • test/test_acp_tool_identity.py: a session-bound directive parked by a child that never got a card is refused, the applier never runs for the parent (against the earlier runner the applier ran once and the map was empty); a child's directive call past the call bound is refused as a child's — also when the roster closed the child before that call, and for a child the roster never listed — with the ordinary note and a denial row with no error (against rev 33 the note read this turn's sub-agents made more tool calls than the card keeps rows for… and the untracked child's row carried error='native_call_bound'); the parent's own directive still applies after a child crosses the bound, on a wire without copies and on one that copies child calls (against rev 33 on the copying wire: Expected 'mock' to have been called once. Called 0 times.). test_a_flat_copy_of_a_childs_result_redacts_a_credential_split_across_frames drives _run_chat with a bearer prefix and its token in separate parent-tagged result frames of an attributed child call and asserts no card frame carries the token — against the previous revision it fails with a bare token crossed the wire: [… ('subagent_chunk', {… 'text': 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8\n'}) …]; with the fix the one result row reads [REDACTED: credential]\nok\n. test_a_childs_refused_directive_reads_as_not_applied_on_its_card_too: the refused directive's card row carries the not-applied note and no marker, as the parent's row does — against the previous revision: the marker reached the card: [('subagent_tool_result', {… 'output': 'armed\n[[KIROCREW_SESSION_DIRECTIVE]]….
  • test/test_tool_call_classification_provenance_bound.py: the child-terminal-result case now expects one EVENT_SUBAGENT_ACTIVITY tagged SUBAGENT_ACTIVITY_TOOL_RESULT, the new contract.
  • test/test_steer_requeue.py: upstream's release-handles test (fix: send a claude steer once its running tool call finishes #32372) builds a stub turn by hand; the stub gains the two fields this change adds to the turn (_native_card_output_len, _native_streams_red), which _turn_release_handles now reads. Two lines, no new tests.

Frontend

  • website/src/test/ActivityViewer.subagentTranscript.test.tsx (24): the label flips off "Starting…" on a reasoning row or a tool call; an opened reasoning row stays the opened one when the cap drops rows (previously the open state moved to the row that slid into its place); a row first seen through its result reads "Tool call" until named; a tool row opens on its input and output, and its toggle's accessible name is the call's title with aria-expanded carrying the state (against the previous component: Unable to find an accessible element with the role "button" and name "git log -1" — every toggle was named "Show this call's input and output"); a failed call's output opens as the role="alert" surface with the scoped hand-off and no plain Output box (the hand-off reads "Ask the agent about this failed call" — against the previous catalogs the three label assertions fail with Unable to find an element with the text: Ask the agent about this failed call) while a completed call's stays plain (previously Unable to find an element by: [data-testid="subagent-transcript-tool-error"]); a failure reported by status alone opens on the same surface with the fallback message — against the previous component: Unable to find an accessible element with the role "button" and name "Show this call's input and output", the failed row could not be opened at all; the disclosures carry Btn's pressed-state class (previously raw buttons); a call whose newest frame says in_progress stays live with plain Output and no error surface — against the previous component: expected document not to contain element, found <svg aria-label="Error"; a failed call on a running card is muted, opens on the error surface, stays muted on a card that COMPLETED and is red on one that ended in failure, as a circled X in every state (against the previous component: expected 'lucide lucide-circle-x …' not to contain 'text-danger' on the Complete card; earlier, 'lucide-circle-alert …' not to contain 'text-danger', then to contain 'lucide-circle-x'); a folded reasoning row previews its first non-blank line, truncated and aria-hidden, and the preview goes when the row opens (against the previous component: Unable to find an element by: [data-testid="subagent-transcript-thinking-preview"]); the finished card's "Full result" toggle carries the tool rows' weight and case (previously text-muted/40, then uppercase text-muted/70); the result-first row reads "Unnamed tool call" (previously "Tool call"); "Activity" / "Full result" on a finished card; reasoning folds; edge fades; the list keeps following the newest row past the cap when two no-output tool rows arrive back to back (against rev 28: expected 3600 to be 4000 — keyed on the row count, the effect never re-ran); the finished card's Output fold and the plain box without rows; a card the inventory retired (fix(dashboard): retire a gone spawn approval everywhere #20987) draws neither its kept rows nor an Output box, expanded or not — against the row without the retired gate: expect(element).not.toBeInTheDocument() found data-testid="subagent-transcript".
  • website/src/test/SubagentTranscript.reducers.test.tsx (16): row building and merging, a refinement and a result landing on the keyed row, a result-first row opening untitled then named, the roster's id-less re-send of a call announced by id landing on that row (against the previous reducer it opened a second row), the batch frame reading only coalescer fields, seq stable across the cap, the cap's omitted count, snapshot carry-over; a reconnect snapshot records the call in flight onto the held rows and recovers no text; a result for an unseen call never claims the roster's id-less status row and a refinement that names a seeded row ends its claimability (against rev 49 both fail: the status row absorbed the output, expected [ { kind: 'tool', …(5) } ] to deeply equal [ …(2) ]).
  • website/src/test/SubagentReplayReconcile.reducers.test.ts (20): perf(web): reconcile the reconnect sub-agent replay into held cards #23797's reconnect-reconcile suite, read against the transcript's tool rows; its six reconcile cases fail on the un-reconciled reducer (expected undefined to deeply equal [ 'fs_read', 'shell' ]), and one expectation follows the transcript's rule for an id-less seeded row (the first id-bearing frame with its title claims it) where the list opened a second row.
  • website/src/test/useWebSocket.frameTrace.test.ts: the recorded contract gains a buffered subagent_thinking run in the reconnect catch-up case and in the snapshot-and-batches case; both land the reasoning as one batch frame before the buffer is cleared (against rev 49 both fail: the reasoning was dropped, GPT 6.1's finding).
  • website/src/test/SubagentTranscript.toolRows.test.tsx (20, ported from the tool-call timeline tests, every Subagents panel: show tool-call timeline and token/cost for each run #13628 rule kept; rev 51 carries main's six is_update refinement cases (feat: show the claude-agent-acp surfaces the dashboard drops #37512) into the transcript's rows — a refinement lands by id wherever its row sits, lastTool moves only when that row is the newest, an unlisted older call's refinement goes before the newest row with a key of its own — and adapts one: a frame naming an earlier call's id refines that row here, one id being one call, where the list opened a second row); ActivityViewerCoverage.test.tsx (five timeline cases ported; a chip-selected finished managed card with rows auto-loads its output from disk — against rev 20: expected document not to contain element, found <button data-testid="subagent-output-toggle" — and heads that box "Full result" — against rev 24: Unable to find an element with the text: Full result; a finished managed card without rows keeps "Output"; a finished error card's "Last tool" line drops Running: — against rev 31: Unable to find an element with the text: /Last tool:\s*git bisect run npm run build/); registry guards chatSlice.publicSurface.test.ts and useWebSocket.frameTrace.test.ts (the latter gains a routing case: reasoning buffered before a result-first row lands first — against rev 31 the sseSubagentToolResult dispatch came first).

Local runs on this head: backend isort, flake8, mypy (runner, owner, bounds module, state, the stop-reason module) and the baselined black gate clean, with the subprocess-encoding, ACP-fixture, SDK-boundary, sync-IO, lockdown and file-line-cap checks; the 93 backend test modules that reference the native-card code, the runner's composition contract, the directive path, the redaction census and the SDK boundary pass, and the whole backend suite passed locally on an earlier revision except 81 failures and 18 errors in 13 host-environment modules that fail identically on a pristine main (none import the changed code). Frontend tsc, eslint, i18n:check, jscpd, feature-map and docs-lint clean, npm run build clean; vitest --changed against the merge-base passes 2,271 files / 39,927 tests (1 expected fail, 2 skipped).

Manual verification

  • Recorded the raw ACP frames kiro-cli 2.31 emits for a native subagent run with a throwaway driver (roster on list_update, everything else child-tagged on session/update); the fixtures in the new test module are those shapes.
  • Drove the built SPA over a mocked WebSocket with the same frame sequence and watched the card through every state below: "Starting…" on spawn; "Running Tool" with live rows as the first frame lands; a tool row opened on its input and output; a live, folded "Thinking…" row and the same row opened; a run past the 200-row cap with a failed call, the list scrolled so each edge fades in turn; a running card whose coalesced count outruns its rows; a running card with a muted failed call among completed ones; a call first seen through its result, untitled then named by its refinement; a failed call with output opened on the error surface; a failure reported by status alone opened on the same surface; a finished card under "Activity" with its failed calls muted and "Full result" folded, and the same result opened with its → title lines carrying no Running: ; a finished run past the call bound, its refused calls titled on the card, the result opening on its truncation marker and ending with the outputs filed under "→ Tool call past the name limit" and the overflow line; and a managed spawn_run card running, with its failed row opened, and finished with its result box open under "Full result" for the disk loader.

Screenshots / video

Synthetic data throughout; the card element only. Every image was shot on this revision's head (633def7fd4), so none predates the code.

The card on spawn, before any frame has arrived (unchanged):

Card just spawned: Starting…, Output box says Waiting for output…

Once the child's frames flow: Running Tool; a folded Thought process row previewing its first line, two completed tool rows, a line of answer text, and the running call:

Card running: Live activity with reasoning, completed tool rows, answer text and the running call

A tool row opened on its input and output:

Tool row expanded to its input JSON and command output

A card whose newest row is reasoning: the label reads Running, the row reads "Thinking", folded, previewing its first line; then the same row opened, the preview gone:

Running label with a live, folded Thinking row previewing its first line

Thinking row opened to its reasoning text, the preview gone

A run past the 200-row cap: "6 earlier steps not shown", the top edge fades over the rows above, the newest call failed — muted while the card runs; the failed call opened on its input and the error surface; the list scrolled back up so the bottom edge fades:

Live activity heading with 6 earlier steps not shown, top fade, and a muted failed tool row

Failed tool row opened on its input and the Tool call failed surface

List scrolled up, bottom edge fading over the rows below

A running card whose coalesced count outruns its rows, and one with a failed call among completed ones — muted, since the card is still running:

Running card whose coalesced count outruns its rows: 6 earlier calls not shown in the heading

Running card with a muted failed call row among completed ones, each folded Thought process row previewing its first line

A call first seen through its result is listed as "Unnamed tool call" until the refinement names it:

Running card: a call first seen through its result renders an Unnamed tool call row

The refinement that follows names the same row

A failed call with output, opened on a running card: the error surface with the shipping hand-off copy; then a failure reported by status alone, opened on the same surface:

Failed call with output opened - Tool call failed surface with the Ask the agent about this failed call hand-off

Failure reported by status alone opened - the same surface with No output was returned

A finished card that COMPLETED: "Activity" heading, its failed calls still muted (the agent finished with them handled), "Full result" folded (at the tool rows' weight); then the result as it opens — at its top, → title lines without Running: — and scrolled to its end, the closing text under the last call's output:

Finished Complete card - Activity heading, its failed rows still muted, folded reasoning rows with previews, Full result folded

Full result opened - it begins at the top, with feed titles that carry no Running prefix

Full result scrolled to its end - the closing text under the last call's output

A run past the call bound (NATIVE_SUBAGENT_CALLS_MAX, 1,024 calls), finished: the calls the bound refused still hold titled rows on the card (a refused call streams; only the gateway's stores take no row for it), the heading counts the rows the 200-row cap dropped, and the Full result — opening on its truncation marker, the gateway keeping the newest 8,000 characters — files those calls' outputs under "→ Tool call past the name limit" and ends with the line that says why: (labelling those live rows, and leading the box with that line, is follow-up #31651)

Finished card of a run past the call bound - its newest rows are the refused calls, titled, with 832 earlier steps not shown

Full result opened on its truncation marker - earlier output truncated, then titled entries

Full result scrolled to its end - the refused calls' outputs under Tool call past the name limit, the closing text, then the overflow line explaining them

A card that ENDED IN FAILURE: the same rows red under "Error"; before it, the running card's folded "Thought process" rows each previewing the first line of their reasoning:

Running card with two failed calls muted and two folded Thought process rows previewing their first lines

Finished card that ended in failure - Error heading, its failed rows red

A managed (spawn_run) card through the same reducers: running with a muted failed row among completed ones; that row opened on the error surface; finished Complete, under "Activity", the row still muted and the result box open under "Full result" for the disk loader (a managed result lives on disk):

Managed card running - Live activity with a muted failed row, a completed row and reasoning

Managed card - failed row opened on its input and the Tool call failed surface

Managed card finished Complete - Activity heading with the failed row still muted and the Full result box open on Load output from disk

Related Issues

Closes #20028

Pattern harvest

Not generalizable: the handle's re-tag was written against an older kiro-cli that also sent parent-tagged copies of a child's calls, and the arm that consumed it was never exercised against a recorded wire; the fix is specific to that protocol drift. The recorded-frame fixtures now pin the shapes, which is the durable part.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@hickoxd
hickoxd requested review from a team and KiroCrewCaptain as code owners October 14, 2026 01:03
@hickoxd
hickoxd requested a review from mbriones98 October 14, 2026 01:03
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision 682c63b2967642dacf55d7797e7f874a0723731f touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 682c63b2967642dacf55d7797e7f874a0723731f via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the new WS frames are additive, the only removed reader (the toolCalls list) is listed with its tests, and 25 downloaded screenshots cover the reshaped card.

Notes

[DESIGN-REVIEWED] 682c63b

Description read

[DESCRIPTION-READ] 1839f37a8f5972aa6264678a20da78fa44a3cde74645b04cf0450ab5b06ae9d7

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 682c63b2967642dacf55d7797e7f874a0723731f via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Every item traces to the reported frozen "Starting…" card, or to a blocking repo rule (a-bound-bounds-every-field-it-retains, errors-use-error-notice). The flat-copy arms rest on the base's own copying wire, so they are not a second spelling.

What this change ships

Inventory (10 items) — 10 justified

Intent: let a person watching a native sub-agent see what it is doing while it runs, rather than "Starting…" until it ends — a FIX.

  1. Card lists the child's tool calls live, with their input — justified
  2. Each call row shows its result/output once the call finishes — justified
  3. Child's reasoning appears on the card, folded like the parent's — justified
  4. The "Tool calls" box is replaced by transcript rows (reasoning/tool/text) — justified
  5. "Starting…" shows only until anything is heard from the child — justified
  6. Finished card's result folds behind "Full result" — justified
  7. A failed call row opens an error notice with the ask-the-agent hand-off — justified
  8. Per-turn call bound; overflow and "past the name limit" lines in the feed — justified
  9. New subagent_tool_result / subagent_thinking WS frames; optional input on subagent_tool — justified
  10. AcpEvent.activity tag forwarded through the provider copy — justified

[FIRST-PRINCIPLES-REVIEWED] 682c63b

Description read

[DESCRIPTION-READ] 2006fc2f26ca1cd5416193d1f0ae1e5134a837a6c4e0009b126d1af2e27a7b18

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — 🔴 changes requested (blocking)

Reviewed 3a5c3e9bbd064649f4ebdf49f7e5c641e86255a7 via the fork AI-review pipeline; updated in place on each push.

Blocking: a background sub-agent card that stays open across parent turns keeps its per-call title and pending-output maps with no cap, because the 1024-call bound only counts the current turn's attribution map.

BLOCKING — src/kiro_crew/dashboard/native_subagent_cards.py:1488
if len(tcid) > NATIVE_SUBAGENT_CALL_ID_CHARS or len(tc_card) >= NATIVE_SUBAGENT_CALLS_MAX: … titles = info.setdefault("call_titles", {}) if not info.get("done") else None
Trigger: a background child marked kept_open keeps making tool calls over several parent turns. At each turn's end, _native_subagent_close_all skips kept_open records, so call_titles and call_pending are not shed, and _carried_background_native carries the record into the next turn as it is. _turn_open then starts a new empty _native_tc_card. The child's new calls each pass _admit_native_call's len(tc_card) check and add another entry to the carried info["call_titles"] (plus a call_pending slot of up to 4000 chars for each call still in progress).
Outcome: the per-record call_titles and call_pending maps grow by up to NATIVE_SUBAGENT_CALLS_MAX entries every turn and have no limit over the child's life. The admission set and the stores it is supposed to bound drift apart, which is the growth this cap claims to refuse.
Anchor: a-bound-bounds-every-field-it-retains
Fix: in _admit_native_call, also refuse when len(info.get("call_titles") or {}) >= NATIVE_SUBAGENT_CALLS_MAX and the id is not already in it. Alternatively, seed the next turn's _native_tc_card from the carried records' call_titles so one admission counts every store.

[BLOCK-MERGE] 3a5c3e9
[OPUS-REVIEWED] 3a5c3e9

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings (all downgraded on adjudication)

Reviewed 3a5c3e9bbd064649f4ebdf49f7e5c641e86255a7 via the fork AI-review pipeline; updated in place on each push.

Opus 5.5 adjudication downgraded every blocking finding. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents.

Review details

BLOCKING -- website/src/store/chat/subagents.ts:1158 -- Reconnect hides output produced during the socket outage

transcript: existing?.transcript?.length ? replayedTranscript : seedTranscript(d.streaming, d.last_tool, d.last_tool_call_id),
Trigger: A running native child already has transcript rows, then produces more output during a socket outage. Reconnect preserves the card, and useWebSocket dispatches the gateway’s updated snapshot to sseSubagentSnapshot.
Outcome: The recovered output updates only streaming; the retained transcript omits it. SubagentPane hides the Output box while a running card has transcript rows, so that output remains invisible until completion, and subsequent chunks append around the missing text.
Anchor: defect
Fix: Keep the authoritative replay feed accessible while the retained transcript is incomplete, or reconcile the recovered output into the displayed rows.

[BLOCK-MERGE-DOWNGRADED] 3a5c3e9
[GPT-REVIEWED] 3a5c3e9

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1: LOW. The bad state is only in the display and doesn't last. It needs a socket outage while a running native child's card already has transcript rows (authentic.patch:5559-5576, subagents.ts:1158). The card then shows only the transcript rows, with no Output box (ActivityViewer.tsx hunk, authentic.patch:4848,4852). Nothing is lost on the gateway. When the child finishes, the "Full result" box shows the whole result (authentic.patch:4852,4886). A reload creates a fresh card, which rebuilds its rows from the snapshot's full feed through seedTranscript (authentic.patch:5594). The PR names this limitation in both the code and the spec, and #31651 tracks a structured snapshot for it (authentic.patch:5551-5558,218-222). The real fix is either that new snapshot protocol or a second copy of the gateway's feed held next to the transcript, with a branch to switch between them on the per-frame path. Either costs more than a temporary display gap that fixes itself.

[ADJUDICATION] 3a5c3e9bbd064649f4ebdf49f7e5c641e86255a7 total=1 uphold=0 downgrade=1
DOWNGRADE F1 website/src/store/chat/subagents.ts:1158 reason=disproportionate-remedy
[GPT-ADJUDICATED] 3a5c3e9bbd064649f4ebdf49f7e5c641e86255a7

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@hickoxd
hickoxd force-pushed the fix/subagent-card-live-transcript branch from 3497ac7 to b54d311 Compare October 14, 2026 05:02
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 14, 2026
@hickoxd
hickoxd force-pushed the fix/subagent-card-live-transcript branch from b54d311 to 251044b Compare October 14, 2026 17:30
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 14, 2026
@hickoxd
hickoxd force-pushed the fix/subagent-card-live-transcript branch from 251044b to 828df8e Compare October 14, 2026 21:08
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 14, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 15, 2026
@hickoxd
hickoxd force-pushed the fix/subagent-card-live-transcript branch from 454f76a to a89f5cf Compare October 15, 2026 19:04
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 15, 2026
mbriones98
mbriones98 previously approved these changes Oct 18, 2026

@mbriones98 mbriones98 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checks green and readiness passed at 633def7; no behavior change.

@hickoxd

hickoxd commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

@mbriones98 could you take another look at this one when you have a moment? Your approval on 633def7f was dismissed by the ruleset: main conflicted with the PR four times after it, so the branch had to move, and the head is now 206f30bd.

What changed since 633def7f:

  • Four forced rebases, each a one-file conflict with an upstream refactor: refactor(dashboard): move DashboardState into state_parts owners #21647 (moved native_subagent_snapshots into state_parts/slot_directory.py), refactor(acp): move the rest of AcpSessionHandle into owner modules #21989 (split acp/session_handle.py into owner modules), refactor(dashboard): hoist the chat turn's closures into chat_turn #22057 (new row in the composition-contract guard's construct-homes table), refactor(website): split the shared types module into six owners #22135 (split website/src/types/index.ts into owner files). Each one relocated the affected hunks into the new owner files with their bodies unchanged. The only rebase-driven additions are the SubagentTranscriptItem re-export in the types facade and the union row in the guard table.
  • Two fixes rode along with the first rebase, both flagged by the Opus lane on 633def7f, each with a regression test proven against the old code: a child's refused session-bound directive no longer reaches its card raw (marker stripped, "not applied" note appended, same as the parent's row), and a finished managed card with transcript rows keeps its disk loader one click away instead of folding it.
  • Screenshot evidence corrected: a four-call card cannot produce an "unnamed tool call" entry (the bound is 1,024 calls), so that staged scene was replaced with a card that actually runs past the bound. All screenshots are re-shot on the current head.

So unlike 633def7f this is not a no-behavior-change head; the two fixes above are the delta, and they are described in the Review notes. State on 206f30bd: all checks green, PR Readiness success, GPT/Opus/Design/First Principles PASS, UX advisory only. Thanks.

@iamwhatever

Copy link
Copy Markdown
Contributor

Holding at 845fc8b.

  1. The branch conflicts with main (mergeable: CONFLICTING). Please rebase. The new head needs a fresh review, so I read only the sensitive paths in this round.
  2. Human review is required. The change touches the session-bound directive gate: _native_owned (native_cards.py#L396-L413) now decides denial at tool_results.py#L403 and #L576, and can refuse an unattributed call once the bound has refused a child call. It also changes the redaction path for child output broadcast over WebSocket, and it adds two new events that carry child tool output and reasoning. A maintainer should sign off on these.
  3. This head's First Principles CONCERNS (flat-copy arms for a wire kiro-cli is not shown to send; the "Full result" fold) and UX CONCERNS (two meanings of "Unnamed tool call"; where "Ask the agent" goes) have no reply. The last author comment describes 206f30b. Please post a disposition per item on the rebased head.

Clears when the branch is rebased, each lane item has a reply, and a maintainer has reviewed the gate and redaction changes.

— crew-pr-reviewer (r116)

@hickoxd

hickoxd commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Rebased: head is now 63d08becc5 on current main (0b89e0c6f7), MERGEABLE. One conflict, in chat_runner.py: #22592 switched the activity arm's permission-notice redaction to redact(...); taken, with the projection call beside it kept. Everything else moved unchanged.

Disposition per lane item on 845fc8b05a, carried to this head:

First Principles

  • Item 7, the flat-copy arms — kept. The copying wire is not this PR's: main already projects a child's parent-tagged calls through _native_tc_card and refuses their session directives (Six session-identity tools are dead on a default install (monitor_start, ask_question, suggest_followup, ...) #755; a base test pins that shape). This PR hardens that path rather than adding it: the past-bound refusal in _native_owned exists because, on an earlier revision, the GPT lane showed a refused child call — which holds no row, so is absent from the map — would have its session-bound directive applied to the parent; the flat result arm went through the per-call redactor because split fragments were crossing bare. Deleting the arms reopens both findings. No kiro-cli version is named for that wire because the repository names none, and I will not invent one. A maintainer's call, and it is laid out in the Review notes.
  • Item 6, the "Full result" fold — kept. The fold was the UX lane's blocking finding on an early revision: the transcript and the result box repeated each other on a finished card. The Goal covers the card while it runs; the finished card's shape follows from giving the transcript its place.

UX

  • "Unnamed tool call" meaning two things — taken on this head. The feed's line for an output whose name the bound dropped is now "→ Tool call past the name limit" (the lane's own phrase from an earlier round), and the overflow line names it; "Unnamed tool call" is now only the live row's pending-name label. A test pins the two wordings apart and the overflow line to the feed line; against the previous constants it fails with assert 'Unnamed tool call' != 'Unnamed tool call'. The screenshot of the past-bound result is re-shot. The other half of the ask — use the Activity row's title in the feed — is not possible: retaining the title past the bound is what the bound forbids (the blocking rule that a bound bounds every field it retains), and the client's rows cap at 200, so no title survives there either. Labelling the live rows or moving the explanation needs a past-bound count on the wire; that is the follow-up PR.
  • The hand-off wording — kept. The hand-off opens a fresh chat, as every "Ask the agent" in the app does. "Ask in a new chat about this failed call" was this PR's label for many revisions; the UX lane then objected that the row and the card carried two names for one hand-off, so it became the card's verb scoped to the call, which is what ErrorNotice's askAgentLabel contract prescribes.

Maintainer review. The three areas named — _native_owned deciding denial at its two call sites in tool_results.py, the redaction path of child output on the WebSocket, and the two new events carrying child tool output and reasoning — are described in Change details and Review notes; the fixtures are a live kiro-cli 2.31 recording. Nothing further can be done from the fork; awaiting a maintainer.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 655727f. This needs a maintainer's review.

The PR changes two security-relevant paths, and policy reserves those for a human:

  • The session-bound directive gate. _native_owned (native_cards.py#L396-L413) now decides denial at both sites in tool_results.py (#L403, #L576). Once flat copies have been seen and any child call has passed the 1,024-call bound, it refuses every unattributed directive for the rest of the turn, the parent's own directives included.
  • The redaction of child tool input, output, reasoning and text. These now go over two new WebSocket events, subagent_tool_result and subagent_thinking. Each child stream has its own rolling redactor (native_cards.py#L320-L393).

I found no concrete defect in either path. The redaction matches what the parent's own streams get, and child text renders through the existing MarkdownRenderer. All lanes pass, and 89 checks pass with 12 skipped.

Two smaller items:

  1. The 2026-10-21 UX disposition says labelling past-bound live rows needs a past-bound count on the wire and calls that "the follow-up PR". No issue tracks it. Please open one and link it in the description.
  2. The author's lane dispositions name 845fc8b and 63d08be. The First Principles item 8 note is restated on this head, so a disposition naming 655727f would keep the record current.

What would clear this: a maintainer reviews the gate and the redaction changes, and the follow-up issue is linked. The new commit needs a fresh human approval.

Reviewed head: 655727f

— crew-pr-reviewer (r117)

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES (issue_required) at 7016421. A maintainer review is still required after that.

  1. Untracked follow-up. On 2026-10-21 the UX disposition said labelling live rows past the 1,024-call bound needs a past-bound count on the wire and called that "the follow-up PR". Our r117 review asked for an issue, and there is still none. Please open one issue for it and link it in the description, or say here that the work is dropped.

  2. Maintainer review. This change alters what is redacted and what is sent over the WebSocket for child output. Child tool input, output, reasoning and text now go through per-child and per-call rolling redactors (native_cards.py#L313-L386, #L600-L659), and the PR adds two new events, subagent_tool_result and subagent_thinking (ws_event_scope.py#L246-L262). I found no concrete defect. Each string is redacted before it is bounded, and only a terminal frame prints a call's output. Policy still reserves these paths for a human.

AI findings judged non-blocking: Design's note on the hash() dedup key compares only against the last output of the same call in one turn (native_subagent_cards.py#L96-L113). UX's "Running Tool" header note is base behaviour that this PR does not change.

All lanes pass, CI is green and PR Readiness is green. This clears when the issue is linked and a maintainer has reviewed the redaction and event changes.

— crew-pr-reviewer (r135)

@tim-finnigan

Copy link
Copy Markdown
Contributor

@hickoxd this is conflicting with main again, can you rebase? Also still need the follow-up issue for labeling past-bound live rows (the past-bound count on the wire), linked in the description, or a note here that it's dropped. Once that's in I'll do the maintainer review of the _native_owned directive gate and the child-output redaction on subagent_tool_result / subagent_thinking.

@hickoxd

hickoxd commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@tim-finnigan rebased onto main, one commit, no content change. the head has moved a few times since your comment because main keeps conflicting with the catalogs and import lists; current head is 20f6dc47da, mergeable.

the follow-up for labelling live rows past the call bound is #31651, linked in the description (review notes, and the past-bound paragraph).

one thing from the rebases that is in the diff now: acp/types.py went over the 2,000-line cap once this PR's 15 lines landed on it, so the stop-reason group moved verbatim into acp/stop_reasons.py, re-exported from types.py. upstream has since trimmed the file, so the cap no longer forces it; happy to drop that delta if you would rather it go separately.

the fork runs on this head are parked for approval.

@iamwhatever

Copy link
Copy Markdown
Contributor

Rebased onto main for @hickoxd; the new head is 110f72349. The author's commit is kept as ebef558e1. Two conflicts came from #23094. In acp/types.py I kept main's new rejection_reason_meta and dropped the stop-reason group, which this PR moves verbatim into acp/stop_reasons.py. In acp/session_handle_updates.py I kept main's child text path through _child_text_activity (its per-child StreamRedactor) and added this PR's thinking arm after it. The second commit, 110f72349, only updates tests: since #32367 a split bearer header keeps its Authorization: Bearer name with the token redacted, and #23094's Codex card tests now pass the card_output_len / streams arguments this PR makes required. The follow-up for past-bound rows is #31651, already linked in the description. @tim-finnigan, this is ready for your review of the _native_owned gate and the child-output redaction.

@iamwhatever

Copy link
Copy Markdown
Contributor

Green on dd8a3f5b0: CI and PR Readiness pass, and the PR merges cleanly. Since 110f72349 the second commit also moves three lines in SubagentTranscript.tsx from text-muted/60 to text-muted, which main's muted-text contrast rule now requires. The iamwhatever change request of 2026-10-29 (issue_required) is answered by #31651, linked in the description. @tim-finnigan, this is ready for your review of the _native_owned gate and the child-output redaction. The new head needs a fresh approval.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at dd8a3f5 for maintainer review. This replaces our r135 change request at 7016421.

Our r135 blocking item is fixed. The past-bound labelling follow-up is tracked in #31651, which is open and covers it, and the description links it.

What holds it: the PR changes what is redacted and what is sent over the WebSocket for native child output, and policy reserves that for a human.

I found no concrete defect. Every child string is redacted before it is bounded. The directive gate still reads main's _native_child_tc (tool_results.py#L405). Since 7016421 the head is a rebase plus test updates for main's bearer redaction and a muted-text contrast fix.

AI findings judged non-blocking:

CI is green: 80 checks succeeded and 11 were skipped, and PR Readiness succeeded. The branch merges cleanly. This clears when a maintainer reviews the child-output redaction and the two new events. A new push needs a fresh review.

— crew-pr-reviewer (r150)

@tim-finnigan

Copy link
Copy Markdown
Contributor

Thanks for linking #31651, that covers what I asked for, and thanks for the squash, PR Hygiene is green again. Backend Tests (3.12, 3) and Coverage Gate are red on 8cb1b3d right now. Once those are green I'll do the review of the _native_owned gate and the child-output redaction.

@iamwhatever

Copy link
Copy Markdown
Contributor

@hickoxd thanks for this fix. It is rebased on main at 8cb1b3d and CI passes, but three AI reviews now block it, and two of them need your call (cc @iamwhatever).

  • Opus 5.5 (comment): a tool result for a call the card has not seen can take over the roster's status row. The card's feed then drifts from the gateway's, so the next reconnect shows the text twice.
  • First Principles (comment): the browser's copy of the gateway feed (feedPastHeld, subagentFeedWire.ts, feedResultLine) is more than the fix needs, and it suggests reseeding a reconnected card through seedTranscript instead. It also flags the acp/stop_reasons.py move as riding along.
  • GPT 6.1 (comment): buffered child reasoning is dropped on reconnect (streamBuffers.ts:399).

Could you decide the scope?

  1. Drop the client feed rebuild and reseed through seedTranscript (this removes the area of the Opus finding), or keep it and fix the Opus finding.
  2. Keep or drop the stop_reasons.py move.

Once that is decided, the GPT streamBuffers fix can follow in the same push. Thanks!

@hickoxd

hickoxd commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@iamwhatever @tim-finnigan scope decided, pushed as 37e416415e (one commit, rebased onto main).

  1. the client feed rebuild is gone. feedPastHeld, subagentFeedWire.ts and the i18n exemption are deleted; a reconnect keeps the rows the browser holds and records the snapshot's latest tool onto them, and the text a disconnect hid is not recovered into the rows. the browser was a second writer of _native_result_feed_line's format with nothing holding the two copies together, and every reconnect finding since rev 39 was them drifting. the right fix is a snapshot that carries transcript rows, which is the same wire change Subagents panel: label live rows past the tool-call name bound, and lead the Full result feed with the overflow note #31651 needs; noted there. the opus finding still gets its fix: a result for an unseen call claims only the row a snapshot seeded, never a roster status row. two tests, both red on 8cb1b3d2a.
  2. the stop_reasons.py split is reverted. types.py is main's plus this change's 15 lines, under the cap. the three docs are back to naming types.py.
  3. the gpt finding is fixed: dropForReconnect and dropSubagentKey land a child's buffered reasoning as one batch frame before they clear the buffer, as the chat stream's reasoning already is. two trace cases in useWebSocket.frameTrace.test.ts, both red on 8cb1b3d2a.

thanks for the rebase and the contrast/redaction commit; both are carried in this commit. the test_taskq_timeline red on 8cb1b3d2a was upstream's #34256, not this change.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates a 25% chance that this change introduces a defect, above the 12% limit for approving on its own.

Approve. The handle now re-tags a native child's tool refinements, results and reasoning as subagent activity, and the dashboard projects them onto the child's card. Every other reader of that event is unaffected: the messaging driver and directive tracker read only tool_call_id, and _to_llm_event forwards the new activity field. The directive-isolation gate still keys on _native_child_tc, which is filled before admission, so the new call bound cannot affect refusals. Every way a card closes (roster, staleness, _on_complete, release) flushes the per-child and per-call redactors before the result is built. Late frames for a closed child do not create new redactors. The new required keyword arguments are passed at every call site. The flat-copy arms are still needed for Claude children and older kiro-cli wires, and they share the same final-frame and rolling-redaction rule. On the frontend, nothing else reads the removed toolCalls list. Both earlier blocking findings (claiming of the roster's status row, and loss of buffered reasoning on reconnect/snapshot) are fixed in the code. Opus/GPT lanes and some lint jobs were still pending; nothing that had completed failed.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit aaa3131d10 · 5419 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@iamwhatever

Copy link
Copy Markdown
Contributor

@hickoxd this PR conflicted with main in one import line of ActivityViewer.tsx, so I rebased it (ff4b61c, main's lucide-react import kept, as it already has ChevronRight). The touched backend tests, the touched frontend tests and the typecheck pass on it.

The Opus review then found one new defect on that head (comment): a background child's call that spans parent turns was admitted twice, so tool_count rose twice and its kept title was replaced by "". Fixed in 3a5c3e9 as the review suggested: _admit_native_call still maps a call already in call_titles, but does not count it again or overwrite its title. test_a_carried_call_seen_again_next_turn_keeps_its_count_and_title fails before the fix and passes after it. Please say if you would rather solve it another way.

hickoxd and others added 2 commits November 18, 2026 00:46
A sub-agent spawned with kiro-cli's native `subagent` tool read
"Starting…" over "Waiting for output…" in the Subagents panel for its
whole run, however long and however many tools it called; the card
changed only when the run finished.

kiro-cli announces the crew's roster on `subagent/list_update`, which
is what spawns and closes the card, and sends everything the child
DOES as `session/update` frames tagged with the child's session id:
its tool calls, two result frames per call, its reasoning and its
text. The handle re-tagged those as subagent activity but kept only
the calls and the text, and the activity arm in the chat runner only
filled the toolCallId-to-card map, waiting for parent-tagged copies of
the call and result that current kiro-cli never sends. So no tool or
chunk frame was ever broadcast for the child. The card's label then
read the absence of streamed answer text as "not started", which a
tool-heavy run never produces until its last message.

Re-tag the child's tool refinements, results and reasoning too, with
an `activity` tag telling the shapes apart, and project each onto the
card from the activity arm: a `subagent_tool` frame per call (a
refinement for the same id refines the row and the count moves once
per call), a `subagent_tool_result` frame with the parser's redacted,
bounded output and the terminal status (output once per call; the
duplicate terminal frame carries the status alone, and the output
joins the done-time result under the call's title), a
`subagent_thinking` frame, and `subagent_chunk` as before.

On the client, fold those frames into a per-card transcript of
reasoning, tool and text rows in arrival order, capped with an
omitted count and carried across a snapshot like the tool list, and
render it inside the card: folded reasoning, tool rows that open on
their input and output with a completed, failed or running state,
and markdown answer text, in place of the single Output box and the
plain Tool calls list while the card has rows. Reserve "Starting…"
for a running card nothing has been heard from.

Review follow-ups folded in:

* The child's reasoning and text streams go through per-child rolling
  redactors (`StreamRedactor`), flushed at the next frame of another
  kind and at the child's end, so a credential kiro-cli streams as two
  chunks never crosses the wire whole — the protection the parent's own
  streams already have. The call-title map a result's row is named from
  is bounded in entries and id length, counts its overflow, and is
  dropped with the redactors when the child ends, so the terminal
  record kept for reconnect replay carries only bounded fields.
* The separate `toolCalls` list and its "Tool calls" box are folded
  into the transcript's tool rows (one list; the snapshot seeds a
  rebuilt card's transcript from its feed and latest tool, so a reload
  no longer hides what the agent did before it), and the coalescer's
  "N earlier calls not shown" count moves to the transcript's heading.
* `subagent_thinking` rides the same coalesced buffer as the text
  chunks (one store update per flush, not per token).
* On a finished card the Output box starts folded behind a toggle: its
  tool outputs and answer are already rows. The transcript fades both
  edges rows sit beyond, and the live row carries `aria-current`.
* Imports sorted; the Bengali strings use the তুমি register.
* The turn-end safety net (`_native_subagent_close_all`, reached on a
  user cancel, a turn failure or a missed terminal roster frame) now
  flushes each child's redactor tails before building its terminal
  result, the way the roster-driven and staleness closes already did,
  so a chunk still withheld when the parent turn ends reaches the card
  instead of being lost; the maps it needs are keyword-only and
  required, and a record the dashboard's stop path already marked done
  sheds its per-run transients there without a frame.
* The call-title bound's overflow count is published wherever the card
  is: on the tool frame that crossed it, every done frame (the stop
  path's too), both native snapshot shapes and their reconnect replay,
  from one helper (`native_overflow_fields`, present when non-zero). A
  refused call is counted once, on its first frame, not once per frame
  (kiro-cli sends two per call). The card keeps it — including on the
  done frame a reconnect replays onto an empty store — and says beside
  the Output box how many calls the result lists without their title.
A background native child's record keeps its call_titles into the next
parent turn, whose call-to-card map starts empty, so the call's next frame
was admitted again: tool_count rose twice and the kept title was replaced
by the result frame's empty one. Re-admit such a call to the map only.

Also keeps acp/types.py under the 2,000-line cap after the rebase: main
grew it to 1,986 lines, so the SUBAGENT_ACTIVITY_* comment now says the
same in two fewer lines.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subagents panel: a native sub-agent's card says "Starting…" for its whole run and shows none of its work

5 participants