refactor: streamline agent host completion variable handling and improve attachment rendering logic#320717
Merged
Conversation
…ove attachment rendering logic
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors how “agent host completion” references (skills/commands) are represented as chat request variables, and adjusts attachment rendering so these completion references are treated as hidden variables rather than visible attachments in the chat UI.
Changes:
- Introduces
toAgentHostCompletionVariableEntry*helpers to centralize ID/value creation for agent-host completion variables. - Updates agent-host input completion handlers and session-state adapters to use the new helpers and to restore completion references from attachment metadata.
- Updates attachment rendering logic (and adds tests) to avoid rendering agent-host completion references as visible attachments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatAttachmentsContentPart.test.ts | Adds coverage ensuring agent-host completion references are not rendered as attachments. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts | Refactors variable construction in tests and adds coverage for restoring hidden completion variables from session state. |
| src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.ts | Adds helper functions to create agent-host completion variable entries (IDs, values, metadata). |
| src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.ts | Uses the new helper for consistent completion variable ID/value generation. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.ts | Filters agent-host completion variables out of the renderable attachments list. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.ts | Converts command/skill “simple” message attachments into hidden completion variable entries when rebuilding variable data. |
| src/vs/sessions/contrib/chat/browser/agentHostInputCompletions.ts | Uses the new helper to construct agent-host completion variable entries consistently in the Sessions app. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 1
…ount and add corresponding test
dmitrivMS
approved these changes
Jun 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.