Commit 30490d2
committed
feat(ai-chat): surface subagent tool calls to the browser UI
The Claude Code SDK delivers the parent agent's tool calls as a stream
of stream_event messages (content_block_start / delta / stop), but the
new Agent subagent dispatcher's internal tool calls arrive batched on
a single assistant message with parent_tool_use_id set — there is no
streaming path. The existing stream_event subagent branch was dead
code under the new dispatcher, so the user saw the parent Agent card
finish immediately and then nothing until the subagent returned.
Extract tool_use blocks from subagent assistant messages and emit
aiProgress + aiToolInfo back-to-back per block, registering each
tool_use id in _toolUseIdToCounter so the existing tool_result handler
can route the response back to the right indicator card. The cards
appear once each subagent tool completes (no streaming preview — the
SDK never gave us one), but they appear instead of being invisible.1 parent f61fefa commit 30490d2
1 file changed
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1612 | 1612 | | |
1613 | 1613 | | |
1614 | 1614 | | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
1615 | 1654 | | |
1616 | 1655 | | |
1617 | 1656 | | |
| |||
0 commit comments