Skip to content

Add inline YAML prompt override debug setting#308309

Open
dileepyavan wants to merge 3 commits intomainfrom
Dileepy/chat_promptOverride
Open

Add inline YAML prompt override debug setting#308309
dileepyavan wants to merge 3 commits intomainfrom
Dileepy/chat_promptOverride

Conversation

@dileepyavan
Copy link
Copy Markdown
Member

Summary

Adds a new advanced debug configuration option to override the agent prompt/tool YAML inline in settings as an alternative to providing a YAML file, and wires this into the tool-calling loop so inline overrides take precedence when both are set.

Changes

  • Introduces github.copilot.chat.debug.promptOverrideString in the Copilot Chat advanced settings.
  • Updates prompt override application to support inline YAML or a YAML file, preferring the inline value when both are configured.
  • Clarifies in the setting description that github.copilot.chat.debug.promptOverrideString takes precedence over github.copilot.chat.debug.promptOverrideFile.
  • Adds tests covering the new configuration key and the inline prompt override behavior.

Testing

  • npm run typecheck

Example

"github.copilot.chat.debug.promptOverrideString": "systemPrompt: \"You are a concise coding assistant. Always explain tool choices briefly.\"\ntoolDescriptions:\n  read_file:\n    description: \"Read a file from the workspace when exact file content is needed.\"\n  grep_search:\n    description: \"Search the workspace for exact text or regex matches before reading files.\""

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Screenshot Changes

Base: 55a24659 Current: bd8cd149

Changed (4)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PluginBrowseMode/Light
Before After
before after
editor/inlineCompletionsExtras/JumpToHint/Dark
Before After
before after

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

Adds an advanced Copilot Chat debug setting that allows overriding the agent prompt/tool YAML inline (via settings), and wires it into the tool-calling prompt build so inline YAML takes precedence over a YAML file override.

Changes:

  • Introduces github.copilot.chat.debug.promptOverrideString (inline YAML) and registers it in the configuration service + package.json.
  • Updates the tool-calling loop to apply prompt/tool overrides from either inline YAML or a configured file, preferring inline.
  • Refactors prompt override logic to support parsing from a string source and adds tests for inline overrides + precedence.
Show a summary per file
File Description
extensions/copilot/src/platform/configuration/common/configurationService.ts Registers the new advanced debug config key for inline YAML prompt overrides.
extensions/copilot/src/extension/test/node/configurations.spec.ts Adds coverage ensuring the new setting key is correctly registered under the advanced section.
extensions/copilot/src/extension/intents/node/toolCallingLoop.ts Applies configured prompt overrides during prompt building, now supporting inline YAML + file with inline precedence.
extensions/copilot/src/extension/intents/node/test/promptOverride.spec.ts Adds tests for inline YAML parsing, invalid YAML handling, and inline-over-file precedence.
extensions/copilot/src/extension/intents/node/promptOverride.ts Implements applyConfiguredPromptOverrides and inline YAML parsing while keeping warning de-dup behavior.
extensions/copilot/package.json Adds the new github.copilot.chat.debug.promptOverrideString advanced setting metadata and description.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 2

logService: ILogService,
): Promise<{ messages: Raw.ChatMessage[]; tools: LanguageModelToolInformation[] }> {
let config: PromptOverrideConfig;
): Promise<PromptOverrideResult> {
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing ")" in the applyPromptOverrides signature is indented one tab deeper than the surrounding function declarations, which looks like a formatting mistake and is inconsistent with the rest of this file. Please align the closing paren with export async function applyPromptOverrides( for readability and to match the existing style.

Suggested change
): Promise<PromptOverrideResult> {
): Promise<PromptOverrideResult> {

Copilot uses AI. Check for mistakes.
dileepyavan and others added 2 commits April 7, 2026 13:11
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants