sessions: skip slash command expansion in agent host sessions#314015
Merged
roblourens merged 2 commits intomainfrom May 4, 2026
Merged
sessions: skip slash command expansion in agent host sessions#314015roblourens merged 2 commits intomainfrom
roblourens merged 2 commits intomainfrom
Conversation
Agent host sessions support prompt/skill slash commands natively, so
the CLI-friendly markdown reference ("Use the skill located at ...")
should not be appended. Wire a `shouldExpandPromptSlashCommand`
callback through `NewChatInputWidget` and have both the new-session
and new-chat-in-session panes opt out when the target provider matches
`ANY_AGENT_HOST_PROVIDER_RE`. Copilot CLI and other providers are
unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes prompt/skill slash-command expansion configurable in the sessions chat input so agent-host-backed sessions can receive native slash commands instead of the CLI-oriented markdown reference. It fits into the vs/sessions chat flow by adjusting how the shared NewChatInputWidget prepares outgoing requests for different session providers.
Changes:
- Added an optional
shouldExpandPromptSlashCommandcallback toNewChatInputWidget. - Updated the new-session chat pane to skip prompt/skill expansion for agent host providers.
- Updated the in-session follow-up chat pane to apply the same agent-host check.
Show a summary per file
| File | Description |
|---|---|
src/vs/sessions/contrib/chat/browser/newChatViewPane.ts |
Wires provider-based slash-command expansion behavior into the new-session chat flow. |
src/vs/sessions/contrib/chat/browser/newChatInput.ts |
Adds the opt-in callback and gates prompt/skill slash-command expansion during send. |
src/vs/sessions/contrib/chat/browser/newChatInSessionViewPane.ts |
Applies the same provider-based expansion rule to the in-session composer. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 1
_send() targets the current active session, which can lag behind the workspace picker selection while trust approval or session-type discovery is in flight. Read providerId from the active session so the expansion decision matches the session that actually receives the request. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
deepak1556
approved these changes
May 4, 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.
Agent host sessions support prompt/skill slash commands natively, so they shouldn't get the CLI-friendly markdown reference (
Use the skill located at [name](file://...)) appended to the message. That expansion was originally added to help non-native agents (e.g. Copilot CLI) locate the file.This change makes the expansion opt-in via a new
shouldExpandPromptSlashCommandcallback onNewChatInputWidget. Both placements of that widget —NewChatViewPane(the new-session page) andNewChatInSessionViewPane(the in-session sub-chat composer) — now check the target provider againstANY_AGENT_HOST_PROVIDER_REand skip expansion for agent hosts. Copilot CLI / other providers are unchanged.(Written by Copilot)