xtab: add PatchBased02 line-number variants and strategy-defaults map#318718
Merged
ulugbekna merged 2 commits intoMay 28, 2026
Conversation
Introduce two new prompting strategies that bake their configuration into the strategy itself: - PatchBased02WithRecentLineNumbers - PatchBased02WithoutRecentLineNumbers Both share the PatchBased02 prompt/response format with currentFile line numbers in 'withoutSpaceAfter' style, no current-file tags, postscript enabled, and next-cursor-line prediction disabled. They differ only in whether recently-viewed documents include line numbers. Add a STRATEGY_CONFIG map and applyStrategyConfig() helper that overlay strategy-specific defaults onto the upstream model configuration. Fold the existing CopilotNesXtab includeTagsInCurrentFile hack into this map so there is a single source of truth for per-strategy baked-in defaults.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the inline-edits “xtab” prompting strategy system by adding two PatchBased02 strategy variants and centralizing per-strategy baked-in defaults into a single overlay mechanism, so that model configs coming from upstream sources (e.g. /models) can be normalized consistently in one place.
Changes:
- Added
PatchBased02WithRecentLineNumbersandPatchBased02WithoutRecentLineNumbersstrategies and routed them through the existing PatchBased02 prompt/response handling paths. - Introduced
STRATEGY_CONFIGplusapplyStrategyConfig()to apply strategy-defined defaults on top of upstreamModelConfiguration. - Replaced the prior inlined
CopilotNesXtabincludeTagsInCurrentFileoverride hack inXtabProviderwith the shared overlay helper.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts | Adds new strategy enum values and implements STRATEGY_CONFIG + applyStrategyConfig() for baked-in per-strategy defaults. |
| extensions/copilot/src/extension/xtab/node/xtabProvider.ts | Uses applyStrategyConfig() when determining the active model configuration and updates system-prompt routing for new strategies. |
| extensions/copilot/src/extension/xtab/common/promptCrafting.ts | Routes the new strategy variants through the PatchBased02 prompt construction logic and postscript/backtick decisions. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 5
dbaeumer
approved these changes
May 28, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduce two new prompting strategies that bake their configuration into
the strategy itself:
Both share the PatchBased02 prompt/response format with currentFile line
numbers in 'withoutSpaceAfter' style, no current-file tags, postscript
enabled, and next-cursor-line prediction disabled. They differ only in
whether recently-viewed documents include line numbers.
Add a STRATEGY_CONFIG map and applyStrategyConfig() helper that overlay
strategy-specific defaults onto the upstream model configuration. Fold
the existing CopilotNesXtab includeTagsInCurrentFile hack into this map
so there is a single source of truth for per-strategy baked-in defaults.
fixes https://github.com/microsoft/vscode-internalbacklog/issues/7826