Skip to content

promptsService: add IInstructionFile and make other types consistent#307226

Merged
aeschli merged 7 commits into
mainfrom
aeschli/comprehensive-sawfish-417
Apr 1, 2026
Merged

promptsService: add IInstructionFile and make other types consistent#307226
aeschli merged 7 commits into
mainfrom
aeschli/comprehensive-sawfish-417

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented Apr 1, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 1, 2026 19:03
@aeschli aeschli enabled auto-merge (squash) April 1, 2026 19:03
@aeschli aeschli self-assigned this Apr 1, 2026
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 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 IInstructionFile and updates getInstructionFiles() to return resolved instruction metadata (name/description + resolved applyTo/paths “pattern”).
  • Renames IResolvedAgentFileIAgentInstructionFile and updates call sites accordingly.
  • Reshapes IChatPromptSlashCommand to expose core fields directly (uri, type, storage, userInvocable, etc.) and adds IResolvedChatPromptSlashCommand for the parsed-file variant returned by resolvePromptSlashCommand().

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).

@aeschli aeschli merged commit 998909d into main Apr 1, 2026
19 checks passed
@aeschli aeschli deleted the aeschli/comprehensive-sawfish-417 branch April 1, 2026 19:57
@vs-code-engineering vs-code-engineering Bot added this to the 1.115.0 milestone Apr 1, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators May 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants