Skip to content

Display model name in subagent session#323158

Open
sukumarp2022 wants to merge 8 commits into
microsoft:mainfrom
im-sandbox-sukumarp:display-subagent-model-name
Open

Display model name in subagent session#323158
sukumarp2022 wants to merge 8 commits into
microsoft:mainfrom
im-sandbox-sukumarp:display-subagent-model-name

Conversation

@sukumarp2022

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 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. The label is updated in place to avoid duplication and is refreshed dynamically when the model arrives via metadata updates.

Accessibility improvements

  • The model name is now included in the aria-label for the collapse button so screen readers announce the model being used. Aria-label generation is centralized and updated whenever the title changes.

Code structure

  • ChatCollapsibleContentPart.updateAriaLabel is now protected to allow overriding, and is overridden in ChatSubagentContentPart to centralize aria-label generation.

Testing

  • Adds tests verifying the model name appears in the title and aria-label across states (active, completed, after metadata updates, after expand/collapse) and that no duplication occurs.

Renders the subagent model name (e.g. GPT-4o) inline in the collapsible title, both while active and after completion, updating dynamically when the model is reported. Includes the model name in the collapse button aria-label by making updateAriaLabel protected and overriding it in the subagent part. Adds a dedicated CSS class and tests.
Copilot AI review requested due to automatic review settings June 26, 2026 16:11

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 pull request improves the chat subagent content part UI by rendering the subagent’s model name inline in the collapsed title and incorporating it into the collapse button’s accessible label. It also updates the collapsible base part to allow subclasses to customize aria-label generation.

Changes:

  • Add an inline model-name label element to ChatSubagentContentPart’s collapsed title and refresh it when model metadata arrives.
  • Override aria-label generation in ChatSubagentContentPart to include the model name for screen readers; make ChatCollapsibleContentPart.updateAriaLabel protected to enable this.
  • Add targeted unit tests and styling for the new inline model label.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatSubagentContentPart.test.ts Adds tests validating model label rendering and aria-label inclusion across states/updates.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css Adds styling for the inline model label in the subagent collapsed title.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.ts Implements inline model label + aria-label override and triggers title refresh on model updates.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.ts Makes updateAriaLabel protected so subclasses can override accessible labeling behavior.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Low

sukumarp2022 and others added 3 commits June 26, 2026 22:06
Addresses review feedback: the base class re-applies its captured initial title to the aria-label on expand/collapse. Derive the base label from the rendered title text (excluding the inline model label) so the accessible name always matches the visible title. Adds a regression test.

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.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Low

sukumarp2022 and others added 2 commits June 27, 2026 08:08
…bust aria test

- updateModelLabel only re-appends the span when it is not already the last child, avoiding unnecessary DOM moves during frequent title updates.\n- The no-model aria-label test now asserts the aria-label equals the rendered title text instead of matching the English word 'model'.

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.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Low

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show model used by Auto in subagents

4 participants