Skip to content

xtab: add PatchBased02 line-number variants and strategy-defaults map#318718

Merged
ulugbekna merged 2 commits into
mainfrom
ulugbekna/xtab-patchbased02-line-number-variants
May 28, 2026
Merged

xtab: add PatchBased02 line-number variants and strategy-defaults map#318718
ulugbekna merged 2 commits into
mainfrom
ulugbekna/xtab-patchbased02-line-number-variants

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

@ulugbekna ulugbekna commented May 28, 2026

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.

fixes https://github.com/microsoft/vscode-internalbacklog/issues/7826

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.
Copilot AI review requested due to automatic review settings May 28, 2026 09:34
@ulugbekna ulugbekna enabled auto-merge (squash) May 28, 2026 09:34
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 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 PatchBased02WithRecentLineNumbers and PatchBased02WithoutRecentLineNumbers strategies and routed them through the existing PatchBased02 prompt/response handling paths.
  • Introduced STRATEGY_CONFIG plus applyStrategyConfig() to apply strategy-defined defaults on top of upstream ModelConfiguration.
  • Replaced the prior inlined CopilotNesXtab includeTagsInCurrentFile override hack in XtabProvider with 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

Comment thread extensions/copilot/src/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts Outdated
Comment thread extensions/copilot/src/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts Outdated
Comment thread extensions/copilot/src/extension/xtab/common/promptCrafting.ts
Comment thread extensions/copilot/src/extension/xtab/node/xtabProvider.ts
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.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new

@ulugbekna ulugbekna merged commit 6911538 into main May 28, 2026
26 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/xtab-patchbased02-line-number-variants branch May 28, 2026 13:28
@vs-code-engineering vs-code-engineering Bot added this to the 1.123.0 milestone May 28, 2026
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.

3 participants