-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Subagents PR 3: UI card rendering #46188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rtfeldman
wants to merge
5
commits into
subagents-pr2
Choose a base branch
from
subagents-pr3
base: subagents-pr2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,640
−10
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4b3efc7 to
4ddad52
Compare
83398fc to
0b8868a
Compare
4ddad52 to
0840c8d
Compare
b365fb8 to
01c26e6
Compare
0840c8d to
8e2e197
Compare
58f6a6f to
0771296
Compare
- Add SubagentDiffStats struct to compute lines added/removed from action_log - Implement render_subagent_collapsed() showing status icon, label, and diff stats - Implement render_subagent_portal() showing bounded scrollable subagent thread view - Add compute_subagent_diff_stats() to extract diff information from subagent's action_log - Add expanded_tool_calls_mut() method for testing - Add visual tests for subagent UI states (collapsed running, portal, collapsed completed) - Restore AgentSharingFeatureFlag that was accidentally removed in PR2 - Add subagent rendering at the entry level for proper tool call interception The collapsed state displays: - Spinning arrow icon for in-progress, checkmark for completed, X for failed - Label from the subagent tool call - File change stats with git-style coloring (+green, -red) when files are changed The portal view displays: - Header with ZedAgent icon, label, Expand Subagent button, and collapse chevron - Bounded scrollable area (max 400px) with full thread content - User messages, assistant messages, and nested tool calls
308e093 to
c539250
Compare
…ations This guide explains: - How the visual test infrastructure works - How to run visual tests and generate screenshots - How to write tests that modify files to show diff stats - How the diff stats computation works - Debugging tips and common issues - Key types and project structure Also reorganizes subagent-related plans into plans/subagents/
c539250 to
3c32d6f
Compare
This implements the visual tests described in plans/subagents/visual-tests.md: ## Visual Test Changes - Add multiple stacked subagent cards (2 subagents with different tasks) - Show diff stats on subagent cards (files changed, lines added/removed) - Add mixed status display (one completed, one in-progress in running test) - Add follow-up agent response text after subagents complete - Reduce window height from 900px to 700px for more compact screenshots - Add assistant message content before tool calls so subagents appear inline ## ActionLog Changes (for test support) - Add test-support feature to action_log crate - Add TrackedBuffer::diff() getter for test access - Add TrackedBuffer::diff_base_len() for debugging - Add ActionLog::tracked_buffers_for_debug() for iterating tracked buffers - Add log dependency for debugging ## Technical Approach The test bypasses ActionLog's async diff computation (which has race conditions between User and Agent change authors) by: 1. Editing buffers first 2. Registering with buffer_created() 3. Directly setting BufferDiff base_text via set_base_text() ## Documentation - Add plans/subagent-visual-test-improvements.md documenting remaining work: - Status icon not reflecting actual status (shows blue dot for all states) - Card width needs margins like other tool calls
- Completed: green checkmark (TodoComplete) - In Progress: blue spinning icon (TodoProgress with animation) - Failed/Canceled/Rejected: red X (XCircle) - Pending/WaitingForConfirmation: gray circle (TodoPending)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:ai
Improvement related to Agent Panel, Edit Prediction, Copilot, or other AI features
cla-signed
The user has signed the Contributor License Agreement
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the UI for displaying subagent tool calls:
Thread view changes
expanded_subagentsstate HashMap for tracking expanded cardsrender_subagent_tool_call()for collapsed card with label and chevronis_subagent()andtool_namefieldSubagentThreadcontent type in tool call renderingAgent panel changes
open_external_thread_with_server()for testing with stubbed serversTest support
acp_thread/test-supportfeature to agent_uiPart of stacked PRs
This is PR 3 of 4 for the subagents feature: