Skip to content

sessions: Stop expanding skill/prompt slash commands#314289

Merged
joshspicer merged 3 commits intomainfrom
agents/59e72543-05e6-4c55-888d-7fc39bfd669b
May 5, 2026
Merged

sessions: Stop expanding skill/prompt slash commands#314289
joshspicer merged 3 commits intomainfrom
agents/59e72543-05e6-4c55-888d-7fc39bfd669b

Conversation

@joshspicer
Copy link
Copy Markdown
Member

Skill and prompt slash commands (e.g., '/my-skill args') are now sent verbatim to agents instead of being expanded into verbose markdown references.

This change is safe because Copilot CLI and Claude code natively understand slash commands, so no functionality is lost. Users' prompts are no longer unnecessarily modified.

Changes

  • Removed the tryExpandPromptSlashCommand() method from slashCommands.ts
  • Removed expansion logic from the chat input _send() method
  • Removed the shouldExpandPromptSlashCommand option from chat input configuration
  • Cleaned up unused imports

Fixes #313376

Skill and prompt slash commands (e.g., '/my-skill args') are now sent verbatim to agents instead of being expanded into verbose markdown references. This change is safe because Copilot CLI and Claude code natively understand slash commands, so no functionality is lost. Users' prompts are no longer unnecessarily modified.

Fixes #313376
Copilot AI review requested due to automatic review settings May 4, 2026 23:39
@joshspicer joshspicer marked this pull request as ready for review May 4, 2026 23:42
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 updates the Agents window (“sessions”) chat input pipeline to preserve user-entered prompt/skill slash commands (for example, /my-skill args) and forward them to the agent verbatim, instead of rewriting them into expanded markdown references.

Changes:

  • Removed prompt/skill slash-command expansion logic from SlashCommandHandler (including the PromptsType dependency).
  • Simplified NewChatInputWidget._send() to always send the original query text (after trimming), without conditional expansion.
  • Removed the now-unused shouldExpandPromptSlashCommand wiring from the new chat view panes (and cleaned up related imports).
Show a summary per file
File Description
src/vs/sessions/contrib/chat/browser/slashCommands.ts Removes tryExpandPromptSlashCommand() and its PromptsType dependency; prompt/skill slash commands remain as completions/decorations only.
src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Drops shouldExpandPromptSlashCommand option plumbing and the unused ANY_AGENT_HOST_PROVIDER_RE import.
src/vs/sessions/contrib/chat/browser/newChatInSessionViewPane.ts Drops shouldExpandPromptSlashCommand option plumbing and the unused ANY_AGENT_HOST_PROVIDER_RE import.
src/vs/sessions/contrib/chat/browser/newChatInput.ts Removes expansion logic from _send() and removes the related option from the widget configuration shape.

Copilot's findings

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Screenshot Changes

Base: 5dd7e4b3 Current: a7c329db

Changed (8)

chat/input/chatInput/Default/Light
Before After
before after
chat/input/chatInput/WithFileChanges/Dark
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Light
Before After
before after
chat/widget/chatWidget/SimpleQA/Light
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Dark
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Light
Before After
before after
chat/widget/chatWidget/MultiTurn/Dark
Before After
before after

@joshspicer joshspicer merged commit 2c53a57 into main May 5, 2026
26 checks passed
@joshspicer joshspicer deleted the agents/59e72543-05e6-4c55-888d-7fc39bfd669b branch May 5, 2026 16:04
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 5, 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.

Avoid changing user prompts when dealing with skills

3 participants