nes: add optimized PatchBased02 prompt strategy - #332018
Open
Julia Gong (juliagongms) wants to merge 7 commits into
Open
nes: add optimized PatchBased02 prompt strategy#332018Julia Gong (juliagongms) wants to merge 7 commits into
Julia Gong (juliagongms) wants to merge 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optimized PatchBased02 inline-edit prompting strategy while reusing existing behavior and configuration.
Changes:
- Registers
patchBased02Optimizedwith shared PatchBased02 configuration. - Routes prompt crafting, response parsing, and system prompts through PatchBased02 behavior.
- Adds focused configuration and system-prompt tests.
Show a summary per file
| File | Description |
|---|---|
xtabPromptOptions.spec.ts |
Tests optimized strategy overrides. |
xtabPromptOptions.ts |
Defines and configures the strategy. |
xtabProvider.spec.ts |
Tests system-prompt selection. |
xtabProvider.ts |
Selects the PatchBased02 system prompt. |
promptCrafting.ts |
Uses PatchBased02 prompt construction. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
Expose a PatchBased02Optimized strategy that shares the existing recent-line-number prompt configuration while giving the optimized inline suggestion treatment a stable, implementation-neutral identifier. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The patchBased02Optimized strategy now inherits everything from patchBased02WithRecentLineNumbers and additionally bakes in the client/latency configuration this unified model was tuned for: patchModelPredictionKind=currentLineCompleted, splitPatchOnDiff, patchFastYieldLineWithCursor, extraDebounceEndOfLine=0, nesMimicGhostTextBehavior, cacheDelay=200, rebasedCacheDelay=0 and debounce=0. These are exposed as optional ModelConfiguration fields (with validators) and resolved at each read site via `modelConfig.<field> ?? experimentDefault`, mirroring the allowImportChanges baking pattern. selectedModelConfiguration() now returns the strategy-resolved config so consumers outside xtabProvider (NextEditProvider, UserInteractionMonitor, inline completion provider) observe the baked values. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 676b2f6f-4b80-4754-8dde-708d7e992148
Julia Gong (juliagongms)
force-pushed
the
juliagong_microsoft/nes-patchbased02-optimized-strategy
branch
from
August 21, 2026 19:33
84916f7 to
df9edb0
Compare
Adds a `supportsUnifiedCompletions` capability to ModelConfiguration, following the `supportsNextCursorLinePrediction` precedent where a baked strategy value overrides the experiment/deployment toggle at each read site. When the selected NES model's strategy sets it, the client runs as the single unified provider: the separate GitHub Copilot completions provider is suppressed and 'github.copilot' is excluded. patchBased02Optimized bakes it to true, so a copilot-proxy /models deployment can drive unification purely from the prompt strategy without relying on inlineCompletionsUnificationModel (ExP), the local inlineEdits.unification setting, or excludedProviders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 676b2f6f-4b80-4754-8dde-708d7e992148
Mohammad javad Dianat (dianatofficial)
left a comment
There was a problem hiding this comment.
Approved. The fix is minimal and correct.
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.
Summary
Adds
patchBased02Optimized, an implementation-neutral prompting strategy for the optimized inline-suggestion treatment. It inherits everything frompatchBased02WithRecentLineNumbers(current/recent-file line numbers, cross-file edits/imports, disabled next-cursor prediction) and additionally bakes in the client, latency, and completions-unification knobs this unified model was tuned for, so a singlepromptingStrategyvalue carries the whole treatment rather than relying on many separate client settings or experiment/deployment toggles.This makes the treatment self-contained enough to ship purely as the prompt template of a
copilot-proxy/modelsdeployment: the proxy only specifiespromptStrategy: "patchBased02Optimized"and the client derives everything else.Analogous to the change for 2-in-1 models made in this PR: #321755
Baked-in configuration
patchBased02Optimizedspreads the sharedpatchBased02WithRecentLineNumbersconfig and adds:patchModelPredictionKindcurrentLineCompletedsplitPatchOnDifftruepatchFastYieldLineWithCursortrueextraDebounceEndOfLine0nesMimicGhostTextBehaviortruecacheDelay200rebasedCacheDelay0debounce0supportsUnifiedCompletionstrueHow it works
ModelConfigurationfields (each with aMODEL_CONFIGURATION_VALIDATORentry), following the same pattern used to bake inallowImportChangesandsupportsNextCursorLinePrediction.modelConfig.<field> ?? experimentDefault, so behavior is unchanged for any strategy that does not set a value.selectedModelConfiguration()returns the strategy-resolved config, so consumers outsidextabProviderobserve the baked values:patchModelPredictionKind,splitPatchOnDiff,patchFastYieldLineWithCursor,extraDebounceEndOfLine) via the already-resolved model config.cacheDelay,rebasedCacheDelay) and UserInteractionMonitor (debounce) injectIInlineEditsModelService.nesMimicGhostTextBehavior) via its existing model service.NullInlineEditsModelServicetest double for the newly-injected dependency.Completions unification
supportsUnifiedCompletionsbakes completions unification into the strategy, following the exactsupportsNextCursorLinePredictionprecedent where a baked capability overrides the deployment toggle at each read site. When the selected NES model's strategy sets it, the client runs as the single unified provider — one baked boolean replaces all three unification settings:inlineCompletionProvider.ts:unificationresolves viaselectedModelConfiguration().supportsUnifiedCompletions ?? InlineEditsUnification(replacesgithub.copilot.chat.advanced.inlineEdits.unification).jointInlineCompletionProvider.ts: the baked flag is observed reactively (viaonModelListUpdated) and OR-ed into the effectivemodelUnification, which both suppresses the separate GitHub Copilot completions provider and pushesgithub.copilotinto the providerexcludes(replacesinlineCompletionsUnificationModel(ExP) andexcludedProviders: "completions,github.copilot"(local)).The baked value never replaces the existing experiment path for other models — it only short-circuits it when set, so unrelated deployments are unaffected.
Intended deployment
{ "modelConfiguration": { "modelName": "copilot-suggestions-lysithea-0024", "promptingStrategy": "patchBased02Optimized", "includeTagsInCurrentFile": false } }No
inlineCompletionsUnificationModel/unification/excludedProviderstoggles are required — the strategy carries them.Testing
npm run typecheck --prefix extensions/copilotapplyStrategyConfig,MODEL_CONFIGURATION_VALIDATOR,pickSystemPrompt,NextEditProvidercaching/speculative, andUserInteractionMonitornpm run precommit