Skip to content

Subagent activity UX.#17570

Merged
gundermanc merged 13 commits intomainfrom
gundermanc/subagent-ux
Mar 2, 2026
Merged

Subagent activity UX.#17570
gundermanc merged 13 commits intomainfrom
gundermanc/subagent-ux

Conversation

@gundermanc
Copy link
Member

@gundermanc gundermanc commented Jan 26, 2026

Summary

Improves the subagents UX to show the 3 most recent individual tool calls, live, as they happen.

Note that this is an incremental step and lacks some refinements. e.g.: pressing 'no' in the confirmation dialog fully cancels the subagent rather than pausing execution and letting you intervene.

It also doesn't yet support multiple subagents running in parallel.

image

Fixes #14309

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gundermanc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly upgrades the user experience for interacting with subagents by implementing a structured, real-time progress display. Instead of basic text output, the CLI now renders a dynamic view of subagent operations, including their thoughts, tool executions, and any encountered errors. This change provides users with clearer insights into the subagent's current state and actions, making the interaction more transparent and informative.

Highlights

  • Enhanced Subagent Activity Display: Introduced a new React component, SubagentProgressDisplay, to provide a richer and more detailed real-time view of subagent activity within the CLI. This replaces simple text updates with structured progress objects.
  • Structured Subagent Progress Streaming: The LocalSubagentInvocation now streams SubagentProgress objects, which encapsulate the subagent's name and a list of recent activities (thoughts, tool calls, errors), allowing for dynamic UI updates.
  • Improved Tool Argument Display: Tool call arguments are now intelligently formatted for display, prioritizing a 'description' field, falling back to 'command', 'file_path', or other relevant arguments, and truncating long strings for readability.
  • Refined Error Handling for Subagents: Subagent execution errors are now captured and presented within the SubagentProgress object, ensuring that error states are visually integrated into the activity stream rather than being displayed as raw error messages.
  • New Types for Subagent Progress: Added SubagentActivityItem and SubagentProgress interfaces in @google/gemini-cli-core to formally define the structure of subagent activity and progress data.
  • Tool Registry Warning: Added a debug warning in LocalAgentExecutor when a tool referenced by an agent is not found in the parent registry, improving diagnosability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-cli gemini-cli bot added the priority/p1 Important and should be addressed in the near term. label Jan 26, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request introduces a new UI component for displaying subagent activity and integrates it into the existing tool result display. It also refactors the subagent invocation logic to stream progress updates as structured objects rather than plain strings, which is a significant improvement for user experience. Tests have been updated to reflect these changes. However, there are a couple of high-severity issues related to redundant truncation logic and a breaking change in the ToolResult API contract, which also touches upon maintaining UI consistency across components.

@gundermanc gundermanc force-pushed the gundermanc/subagent-ux branch from ebd3bbb to 7e25901 Compare February 25, 2026 16:56
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Size Change: +12.4 kB (+0.05%)

Total Size: 25.8 MB

Filename Size Change
./bundle/gemini.js 25.3 MB +12.4 kB (+0.05%)
ℹ️ View Unchanged
Filename Size
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

@gemini-cli
Copy link
Contributor

gemini-cli bot commented Feb 26, 2026

Hi there! Thank you for your contribution to Gemini CLI. We really appreciate the time and effort you've put into this pull request.

To keep our backlog manageable and ensure we're focusing on current priorities, we are closing pull requests that haven't seen maintainer activity for 30 days. Currently, the team is prioritizing work associated with 🔒 maintainer only or help wanted issues.

If you believe this change is still critical, please feel free to comment with updated details. Otherwise, we encourage contributors to focus on open issues labeled as help wanted. Thank you for your understanding!

@gemini-cli gemini-cli bot closed this Feb 26, 2026
@gundermanc gundermanc reopened this Feb 26, 2026
Copy link
Member Author

@gundermanc gundermanc left a comment

Choose a reason for hiding this comment

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

deleted

@gundermanc gundermanc marked this pull request as ready for review February 27, 2026 04:23
@gundermanc gundermanc requested a review from a team as a code owner February 27, 2026 04:23
@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 27, 2026
@gundermanc gundermanc removed the status/need-issue Pull requests that need to have an associated issue. label Feb 27, 2026
@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Feb 27, 2026
Copy link
Collaborator

@abhipatel12 abhipatel12 left a comment

Choose a reason for hiding this comment

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

LGTM with one comment about the thought being sticky and a couple of other nits/thoughts for later


// Create an activity callback to bridge the executor's events to the
// tool's streaming output.
const onActivity = (activity: SubagentActivityEvent): void => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Maybe not now, but could be an opportunity to extract some of this into a separate method, etc to make it easier to read this file.


const INPUT_PREVIEW_MAX_LENGTH = 50;
const DESCRIPTION_MAX_LENGTH = 200;
const MAX_RECENT_ACTIVITY = 3;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think for now this probably makes sense but ideally the CLI/TUI layer is completely in charge of what they want to display, etc. The core should really just emit what it's doing, etc.

But with the state of things, this is great since we already do this for the other fields.


const INPUT_PREVIEW_MAX_LENGTH = 50;
const DESCRIPTION_MAX_LENGTH = 200;
const MAX_RECENT_ACTIVITY = 3;
Copy link
Collaborator

Choose a reason for hiding this comment

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

From testing this out, wdyt of keeping it as 3 but making sure the top 1 is always a "thought'.

Sometimes, there a long chain of no thought tool calls and it can be harder to gauge what the subagent is doing. With a thought i have an idea of the latest CoT reasoning.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not seeing any thoughts bubbling through anymore for some reason. In the interest of unblocking this piece, I'm going to check in this PR and follow up with cleanup for thoughts.

@gundermanc gundermanc enabled auto-merge March 2, 2026 20:53
@gundermanc gundermanc added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit 7ca3a33 Mar 2, 2026
27 checks passed
@gundermanc gundermanc deleted the gundermanc/subagent-ux branch March 2, 2026 21:22
BryanBradfo pushed a commit to BryanBradfo/gemini-cli that referenced this pull request Mar 5, 2026
struckoff pushed a commit to struckoff/gemini-cli that referenced this pull request Mar 6, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] Subagent Activity Streaming

2 participants