# Render subagents in thread \(\#46188\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/581e559002bbcf9ea3611fdafc89c20a82abca39)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 581e559002bbcf9ea3611fdafc89c20a82abca39

Requested commit: 581e559002bbcf9ea3611fdafc89c20a82abca39

Commit: 581e559002bbcf9ea3611fdafc89c20a82abca39

Tree: 0b4271ffaaf3e9251866373b44460ef738a5d369

Author: Richard Feldman

Committer: GitHub

## Message

```
Render subagents in thread (#46188)

## Summary

This PR adds the UI for displaying subagent tool calls:

### Thread view changes
- Add `expanded_subagents` state HashMap for tracking expanded cards  
- Implement `render_subagent_tool_call()` for collapsed card with label
and chevron
- Add subagent detection via `is_subagent()` and `tool_name` field
- Handle `SubagentThread` content type in tool call rendering
- Add expand/collapse toggle button for subagent cards
- Style collapsed cards similar to terminal tool calls
- Support inline image rendering in content blocks

### Agent panel changes
- Add `open_external_thread_with_server()` for testing with stubbed
servers

### Test support
- Add `acp_thread/test-support` feature to agent_ui
- Add base64 dev dependency for image tests

Release Notes:

- N/A

---------

Co-authored-by: Amp <amp@ampcode.com>
```

## Parents

- [5e5951a43efb15b01d11ab4ffbf12ac968e26120](https://git.cafe/gitcafe/zed/commit/5e5951a43efb15b01d11ab4ffbf12ac968e26120?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/581e559002bbcf9ea3611fdafc89c20a82abca39?format=markdown)
