promptsService: add IInstructionFile and make other types consistent#307226
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the workbench IPromptsService type model to make instruction files and slash-command prompt metadata more consistent and directly consumable, reducing the need for downstream consumers to re-parse prompt headers.
Changes:
- Introduces
IInstructionFileand updatesgetInstructionFiles()to return resolved instruction metadata (name/description + resolved applyTo/paths “pattern”). - Renames
IResolvedAgentFile→IAgentInstructionFileand updates call sites accordingly. - Reshapes
IChatPromptSlashCommandto expose core fields directly (uri,type,storage,userInvocable, etc.) and addsIResolvedChatPromptSlashCommandfor the parsed-file variant returned byresolvePromptSlashCommand().
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/test/browser/componentFixtures/sessions/aiCustomizationListWidget.fixture.ts | Updates fixtures to use IAgentInstructionFile. |
| src/vs/workbench/test/browser/componentFixtures/chat/promptFilePickers.fixture.ts | Updates fixtures to use IAgentInstructionFile and new return types. |
| src/vs/workbench/test/browser/componentFixtures/aiCustomizationManagementEditor.fixture.ts | Updates mock prompts service + adapts to new slash-command shape (but contains a type error; see comment). |
| src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts | Migrates tests to getInstructionFiles() and new slash-command properties; adds coverage for resolved instruction metadata. |
| src/vs/workbench/contrib/chat/test/common/promptSyntax/service/mockPromptsService.ts | Updates mock service method signatures for new types. |
| src/vs/workbench/contrib/chat/test/browser/chatTipService.test.ts | Migrates tests to IAgentInstructionFile. |
| src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.ts | Propagates IAgentInstructionFile renaming through locator APIs. |
| src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts | Implements new instruction discovery info + reshaped slash-command resolution types. |
| src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts | Introduces/updates exported types (IInstructionFile, IAgentInstructionFile, IResolvedChatPromptSlashCommand, etc.). |
| src/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser.ts | Adds evaluateApplyToPattern helper for consistent instruction “pattern” derivation. |
| src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.ts | Switches to IInstructionFile inputs and uses resolved pattern instead of re-parsing headers. |
| src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.ts | Updates prompt-slash-command URI access to new slash-command shape. |
| src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts | Uses userInvocable and uri directly from slash-command objects. |
| src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts | Adapts prompt run telemetry to new slash-command fields. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts | Uses getInstructionFiles() and resolved instruction patterns; updates slash-command property access. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.ts | Updates debug output for new slash-command shape. |
| src/vs/sessions/contrib/sessions/test/browser/customizationCounts.test.ts | Updates sessions tests to new agent-instruction + slash-command shapes. |
| src/vs/sessions/contrib/sessions/test/browser/aiCustomizationShortcutsWidget.fixture.ts | Updates shortcuts fixture to new slash-command shape. |
| src/vs/sessions/contrib/sessions/browser/customizationCounts.ts | Updates counting logic to use c.type/c.storage/c.uri instead of promptPath. |
| src/vs/sessions/contrib/chat/browser/slashCommands.ts | Updates sessions slash-command filtering and expansion to new fields. |
| src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.ts | Updates filtering to treat slash commands as first-class prompt items (no promptPath). |
Yoyokrazy
approved these changes
Apr 1, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.