Skip to content

sessions: skip slash command expansion in agent host sessions#314015

Merged
roblourens merged 2 commits intomainfrom
agents/use-the-skill-located-at-vsckb-implement-file-90e6b60a
May 4, 2026
Merged

sessions: skip slash command expansion in agent host sessions#314015
roblourens merged 2 commits intomainfrom
agents/use-the-skill-located-at-vsckb-implement-file-90e6b60a

Conversation

@roblourens
Copy link
Copy Markdown
Member

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 shouldExpandPromptSlashCommand callback on NewChatInputWidget. Both placements of that widget — NewChatViewPane (the new-session page) and NewChatInSessionViewPane (the in-session sub-chat composer) — now check the target provider against ANY_AGENT_HOST_PROVIDER_RE and skip expansion for agent hosts. Copilot CLI / other providers are unchanged.

(Written by Copilot)

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>
Copilot AI review requested due to automatic review settings May 4, 2026 02:59
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

No screenshot changes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 shouldExpandPromptSlashCommand callback to NewChatInputWidget.
  • 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

Comment thread src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Outdated
@roblourens roblourens marked this pull request as draft May 4, 2026 03:10
_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>
@roblourens roblourens marked this pull request as ready for review May 4, 2026 03:33
@roblourens roblourens enabled auto-merge (squash) May 4, 2026 03:33
@roblourens roblourens merged commit 85f836e into main May 4, 2026
26 checks passed
@roblourens roblourens deleted the agents/use-the-skill-located-at-vsckb-implement-file-90e6b60a branch May 4, 2026 03:49
@vs-code-engineering vs-code-engineering Bot added this to the 1.119.0 milestone May 4, 2026
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.

3 participants