Repository navigation
nes: let settings and experiments override baked strategy values - #333423
Merged
Ulugbek Abdullaev (ulugbekna) merged 4 commits intoAug 30, 2026
Merged
Ulugbek Abdullaev (ulugbekna) merged 4 commits into
Ulugbek Abdullaev (ulugbekna) merged 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
extensions/copilot/src/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts — Preserve compatibility with the already-shipped patchBased02Optimized wire value during this… |
What changed in this PR
Reworks inline-edits configuration precedence so user and experiment values override model-baked defaults, while introducing unified PatchBased02 behavior.
Changes:
- Centralizes user > experiment > model > default resolution.
- Integrates unified-completions capability across provider registration and requests.
- Adds configuration, model-selection, and strategy tests.
| File | Description |
|---|---|
platform/inlineEdits/test/node/inlineEditsModelService.spec.ts |
Tests model capability selection. |
platform/inlineEdits/test/common/xtabPromptOptions.spec.ts |
Updates unified-strategy tests. |
platform/inlineEdits/test/common/modelConfigurationResolution.spec.ts |
Tests precedence and reactivity. |
platform/inlineEdits/node/inlineEditsModelService.ts |
Exposes selected-model capability. |
platform/inlineEdits/common/modelConfigurationResolution.ts |
Adds model-config resolution helpers. |
platform/inlineEdits/common/inlineEditsModelService.ts |
Extends the model-service contract. |
platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts |
Defines unified strategy configuration. |
platform/configuration/vscode/test/configurationServiceImpl.spec.ts |
Tests explicit and experiment values. |
platform/configuration/vscode/configurationServiceImpl.ts |
Uses centralized configuration resolution. |
platform/configuration/test/common/inMemoryConfigurationService.ts |
Supports explicit in-memory overrides. |
platform/configuration/common/defaultsOnlyConfigurationService.ts |
Reuses shared experiment handling. |
platform/configuration/common/configurationService.ts |
Adds “if set” accessors and caching. |
lib/node/chatLibMain.ts |
Integrates validated chat-library overrides. |
extension/xtab/test/node/xtabProvider.spec.ts |
Updates strategy and service mocks. |
extension/xtab/node/xtabProvider.ts |
Applies centralized precedence to runtime knobs. |
extension/xtab/common/promptCrafting.ts |
Handles the renamed unified strategy. |
extension/inlineEdits/vscode-node/unifiedCompletions.ts |
Centralizes unified-completions state. |
extension/inlineEdits/vscode-node/jointInlineCompletionProvider.ts |
Uses shared unification state. |
extension/inlineEdits/vscode-node/inlineEditProviderFeature.ts |
Reactively registers unified providers. |
extension/inlineEdits/vscode-node/inlineCompletionProvider.ts |
Aligns request behavior with registration. |
extension/inlineEdits/test/node/nextEditProviderSpeculative.spec.ts |
Updates model-service fixture. |
extension/inlineEdits/test/node/nextEditProviderCaching.spec.ts |
Updates model-service fixture. |
extension/inlineEdits/node/nextEditProvider.ts |
Resolves model-baked cache delays. |
extension/inlineEdits/common/userInteractionMonitor.ts |
Resolves model-baked debounce values. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…o the base class `ConfigurationServiceImpl` and `DefaultsOnlyConfigurationService` each carried a verbatim copy of the five-step treatment-variable lookup, so every change to the lookup order had to be made twice. Move the shared resolution into `AbstractConfigurationService`: `getExperimentBasedConfig` becomes concrete there, built from a `_getExperimentTreatment` helper and a `_getUserConfiguredExperimentBasedValue` hook that defaults to "nothing configured" and is overridden by the implementation that can actually read user settings. No behavior change. Co-authored-by: Copilot <[email protected]>
… name a setting is published under `getExperimentBasedConfig` resolves a treatment under any of five names -- the setting's `experimentName`, `copilotchat.config.<id>`, `config.<fullyQualifiedId>`, and two more for a migrated setting's old id -- but `updateExperimentBasedConfiguration` only recognized `config.<fullyQualifiedId>` and the old id's equivalent. A treatment arriving under one of the other names therefore assigned the setting without notifying anyone observing it, so every `getExperimentBasedConfigObservable` consumer kept serving the pre-treatment value until some unrelated configuration change happened to invalidate it. Match the same alias list the resolution uses. The new set is a superset of the old one, so nothing that used to invalidate stops doing so. Co-authored-by: Copilot <[email protected]>
…lues `getExperimentBasedConfig` resolves user setting -> experiment treatment -> setting default, and there was no way to ask which of those three a value came from. Callers that have another source of defaults therefore had to place that source *above* the setting, defeating both the user's own configuration and the remote experiment lever. Add `getExperimentBasedConfigIfSet` (plus an observable form) which reports only the explicitly provided value, so such a caller can fall back to its own default only when the setting is not driven by the user or by an experiment. The observable cache is now keyed by accessor as well as setting id: it previously keyed on the setting id alone, so observing one setting through two accessors would have handed back the wrong observable. No key could reach both accessors before, since a simple and an experiment-based setting are distinct types, but a third accessor makes the collision reachable. Co-authored-by: Copilot <[email protected]>
The `patchBased02Optimized` strategy (#332018 / #332316) bakes in the client and latency knobs its model was tuned for, so a `copilot-proxy` `/models` deployment can ship the whole treatment as one `promptStrategy` value. Every read site resolved it as `modelConfig.x ?? getExperimentBasedConfig(x)`. Since `getExperimentBasedConfig` already resolves user setting -> experiment treatment -> default, putting the model configuration first placed it above *both*: once a strategy baked a knob in, neither the user nor a flight could move it, and an A/B arm assigning one of these settings measured nothing. Reads now go through `resolveModelConfigValue`, which consults the strategy only when the setting is not explicitly driven: user setting, then experiment treatment, then model configuration, then the setting default. Registration-time reads use the observable form, since an imperative read inside an `autorun` would not subscribe and would miss a treatment arriving after the graph was built. `supportsUnifiedCompletions` was resolved in two places -- `InlineEditProviderFeature` for the provider `excludes` and `InlineCompletionProviderImpl` per request -- which were free to disagree. If registration excluded the separate provider while a request declined to stand in for it, the user would be left with no inline suggestion at all. Both, plus the joint provider, now resolve through one `observeUnifiedCompletions`, which keeps the existing OR with the core `modelUnification` toggle. `defaultModelConfiguration()` now applies `applyStrategyConfig` as well, so the `forceUseDefaultModel` fallback stops silently dropping every baked knob. The strategy is renamed from `patchBased02Optimized` to `patchBased02Unified`: "optimized" did not say what the variant does, while "unified" names its defining property and matches the existing `xtabUnifiedModel`. Nothing sends the old wire value -- no live experiment assigns it -- so the wire value is renamed with the identifier rather than letting the two spellings drift apart. Note that flights currently assigning these settings win over the baked values, so the strategy only becomes self-contained for those users once those flights are retired. The startup window on the fetched `/models` path (#332837) is unchanged and remains a known limitation. Co-authored-by: Copilot <[email protected]>
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
ulugbekna/agents/revert-commit-fix-config-issues
branch
from
August 30, 2026 19:36
d8c0603 to
e9df460
Compare
Ulugbek Abdullaev (ulugbekna)
marked this pull request as draft
August 30, 2026 19:44
auto-merge was automatically disabled
August 30, 2026 19:44
Pull request was converted to draft
Ulugbek Abdullaev (ulugbekna)
marked this pull request as ready for review
August 30, 2026 19:50
Ulugbek Abdullaev (ulugbekna)
enabled auto-merge (squash)
August 30, 2026 21:13
Benjamin Christopher Simmonds (benibenj)
approved these changes
Aug 30, 2026
Ulugbek Abdullaev (ulugbekna)
deleted the
ulugbekna/agents/revert-commit-fix-config-issues
branch
August 30, 2026 21:35
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Follow-up to #332018 / #332316, addressing two problems with the
patchBased02Optimizedstrategy.Originally this was structured as a revert of e845953 plus a re-land. That is no longer possible: #332802 and its follow-ups have since merged on top of e845953, so reverting would take a colleague's merged work with it and leaves four commits that do not compile. The change is now expressed directly on top of current
main, with the same end state.1. Model configuration outranked settings and experiments
Every baked knob was read as
modelConfig.x ?? getExperimentBasedConfig(x). SincegetExperimentBasedConfigalready resolves user setting → experiment treatment → default, putting the model configuration first placed it above both. Once a strategy baked a knob in, neither the user nor a flight could move it, and an A/B arm assigning one of these settings measured nothing.Reads now go through
resolveModelConfigValue:This needed a new configuration primitive,
getExperimentBasedConfigIfSet, which reports only an explicitly provided value instead of falling back to the default — that is what makes "is this setting actually driven?" answerable. Registration-time reads use the observable form, since an imperative read inside anautorunwould not subscribe and would miss a treatment arriving after the graph was built.2. Two definitions of "unified" that could disagree
supportsUnifiedCompletionswas resolved inInlineEditProviderFeature(for the providerexcludes) and again per request inInlineCompletionProviderImpl. Nothing kept them in agreement, and disagreement is user-visible: if registration excludes the separate provider while a request declines to stand in for it, there is no inline suggestion at all. Both paths, plus the joint provider, now resolve through oneobserveUnifiedCompletions, which keeps the existing OR with the coremodelUnificationtoggle.Also
defaultModelConfiguration()appliesapplyStrategyConfig, so theforceUseDefaultModel(404) fallback stops silently dropping every baked knob.patchBased02Optimized→patchBased02Unified. "Optimized" did not say what the variant does; "unified" names its defining property and matches the existingxtabUnifiedModel. The wire value is renamed with the identifier — see the reviewer thread on this.updateExperimentBasedConfigurationonly matchedconfig.<fullyQualifiedId>, so a treatment arriving undercopilotchat.config.<id>never invalidated the setting's observers. This affects every existinggetExperimentBasedConfigObservableconsumer, not just this change, so it is a separate commit.Commits
Each compiles independently.
configuration: refactor:— hoist the duplicated treatment lookup into the base class (no behavior change)configuration: fix:— invalidate observables for every treatment name a setting is published underconfiguration: feat:— addgetExperimentBasedConfigIfSetnes: fix:— the precedence inversion, the single unified-completions definition, and the renameKnown limitations
supportsUnifiedCompletionsis the only baked value read at provider-registration time rather than per request, so on the fetched/modelspath there is a brief window before the model list resolves. Measured at ~600 ms against a real account.Testing
npm run typecheck --prefix extensions/copilot, and each commit typechecks independentlyplatform/inlineEdits,platform/configuration,platform/proxyModels,extension/inlineEdits,extension/xtabpatchBased02Unifiedand rejected withpatchBased02Optimized(Expected undefined, but got string), confirming the rename end to end