Conversation
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates workbench chat “classic” slash commands to be scoped using chat session types (string IDs like local, copilotcli) rather than prompt targets (e.g. Target.VSCode), aligning slash-command visibility with the session/provider model used elsewhere in chat.
Changes:
- Replaced
IChatSlashData.targetswithIChatSlashData.sessionTypesand updated slash-command registration and filtering accordingly. - Introduced
SessionTypeconstants inchatSessionsService.tsand reused them in slash-command registrations. - Refactored agent session provider identifiers to reference the new
SessionTypeconstants.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.ts | Updates slash command metadata from targets to sessionTypes. |
| src/vs/workbench/contrib/chat/common/chatSessionsService.ts | Adds SessionType well-known IDs and reuses it for localChatSessionType. |
| src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts | Updates completion filtering to use sessionTypes instead of prompt Target. |
| src/vs/workbench/contrib/chat/browser/chatSlashCommands.ts | Updates built-in slash command registrations to use sessionTypes (via SessionType). |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.ts | Attempts to reuse SessionType values in AgentSessionProviders. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 1
| export enum AgentSessionProviders { | ||
| Local = 'local', | ||
| Background = 'copilotcli', | ||
| Cloud = 'copilot-cloud-agent', | ||
| Claude = 'claude-code', | ||
| Codex = 'openai-codex', | ||
| Growth = 'copilot-growth', | ||
| AgentHostCopilot = 'agent-host-copilot', | ||
| Local = SessionType.Local, | ||
| Background = SessionType.CopilotCLI, | ||
| Cloud = SessionType.CopilotCloud, | ||
| Claude = SessionType.ClaudeCode, | ||
| Codex = SessionType.Codex, | ||
| Growth = SessionType.Growth, | ||
| AgentHostCopilot = SessionType.AgentHostCopilot, | ||
| } |
There was a problem hiding this comment.
AgentSessionProviders is a string enum, but its members are initialized with SessionType.* constants. TypeScript requires string-enum members to be string literals (computed/variable initializers are not allowed), so this will not compile. Consider either reverting these enum initializers back to string literals, or replacing AgentSessionProviders with a const object/union type (or making SessionType itself a const enum) so you can safely reuse the shared values.
See below for a potential fix:
export const AgentSessionProviders = {
Local: SessionType.Local,
Background: SessionType.CopilotCLI,
Cloud: SessionType.CopilotCloud,
Claude: SessionType.ClaudeCode,
Codex: SessionType.Codex,
Growth: SessionType.Growth,
AgentHostCopilot: SessionType.AgentHostCopilot,
} as const;
export type AgentSessionProviders = typeof AgentSessionProviders[keyof typeof AgentSessionProviders];
/**
* A session target is either a well-known {@link AgentSessionProviders} value
* or a dynamic string for dynamically-registered providers (e.g. remote
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot copilot@github.com