Skip to content

Display model name in subagent session#322048

Open
sukumarp2022 wants to merge 5 commits into
microsoft:mainfrom
im-sandbox-sukumarp:main
Open

Display model name in subagent session#322048
sukumarp2022 wants to merge 5 commits into
microsoft:mainfrom
im-sandbox-sukumarp:main

Conversation

@sukumarp2022

@sukumarp2022 sukumarp2022 commented Jun 19, 2026

Copy link
Copy Markdown

Fixes - #321923

This pull request improves the Chat subagent UI by displaying the model name used by a subagent inline in the title and ensuring it is included in accessibility labels. It also adds comprehensive tests to verify this behavior and introduces a dedicated CSS class for consistent styling of the model label.

UI improvements:

  • The model name (e.g., "GPT-4o", "Claude Sonnet 4") is now shown inline in the subagent title if available, both while the tool is active and after completion. This prevents duplication and ensures the label is updated dynamically if metadata changes. (chatSubagentContentPart.ts, chatSubagentContent.css) [1] [2] [3] [4] [5]

Accessibility improvements:

  • The model name is now included in the aria-label for the collapse button, ensuring screen readers announce the model being used. The logic for generating the aria label is centralized and updated whenever the title changes. (chatSubagentContentPart.ts)

Code structure & maintainability:

  • The updateAriaLabel method is made protected in the base class to allow for overriding, and is overridden in the subagent part to use the new aria label logic. (chatCollapsibleContentPart.ts, chatSubagentContentPart.ts) [1] [2]

Testing:

  • Extensive new tests are added to verify that the model name appears in the title and aria-label in all relevant scenarios, including after metadata updates, after expand/collapse, and ensuring no duplication occurs. (chatSubagentContentPart.test.ts)

Copilot AI review requested due to automatic review settings June 19, 2026 07:07
@sukumarp2022

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI 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.

Pull request overview

This PR enhances the VS Code Chat subagent content part by surfacing the subagent’s model name in the collapsible title UI and ensuring the same information is reflected in the collapse button’s accessible label. It also introduces a dedicated CSS hook for styling the model label and adds browser-widget tests to cover the new behaviors.

Changes:

  • Render the subagent model name inline in the title (active + completed) and incorporate it into the computed aria-label.
  • Make ChatCollapsibleContentPart.updateAriaLabel overridable (protected) and override it in the subagent part to centralize aria-label generation.
  • Add tests validating model-name rendering, aria-label behavior, and non-duplication across updates.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatSubagentContentPart.test.ts Adds test coverage for model name display and aria-label updates across states.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css Adds .chat-subagent-model-label styling for the inline model label.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.ts Implements inline model label rendering and centralized aria-label generation, plus update plumbing.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.ts Makes updateAriaLabel protected to support subclass overrides.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 1

sukurcf and others added 2 commits June 19, 2026 12:54
Address review comment: modelNameChanged now detects when modelName is
removed/cleared (not just when a new value arrives), and updateHover()
properly disposes the hover tooltip when modelName becomes undefined.

Copilot AI 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.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 1

Copilot AI 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.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants