fix(copilot): honor catalog-supported xhigh instead of unconditional downgrade (salvage #62028) - #65727
Merged
Merged
Conversation
The current code unconditionally downgrades 'xhigh' to 'high' whenever 'high' is in supported_efforts, even if 'xhigh' is also supported. This prevents users from using extended thinking on providers like Copilot that list 'xhigh' in their supported efforts. Fix: only downgrade 'xhigh' to 'high' when 'xhigh' is NOT in the provider's supported efforts list.
…not xhigh->high The Copilot provider profile unconditionally mapped ``xhigh`` to ``high`` before checking the model's catalog, so models that DO support ``xhigh`` (e.g. the gpt-5.x family per the live /models catalog) were silently capped one level down. Honor the requested effort when the catalog lists it as supported, and only downgrade when it does not, choosing the nearest weaker supported level (xhigh->high, minimal->low, else medium, else the first supported level). This matches the nearest-down clamp behavior used elsewhere for the ``max`` effort. Adds tests/plugins/model_providers/test_copilot_profile.py covering forward, downgrade, and fallback paths (catalog lookup stubbed).
Add current-main regression coverage for both the registered provider profile and core GitHub Responses path while leaving live catalog loading to the complementary catalog-resolution work in #51953.
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
Copilot reasoning-effort negotiation now honors the model's supported-effort set instead of unconditionally collapsing
xhigh/max/ultratohigh— downgrade happens only when the requested level is genuinely unsupported, choosing the nearest weaker supported level.Salvage of #62028 by @hydraxman (which itself preserved commits from #10391/#51480 by @AlsayedHoota and @arminanton — all three authorships preserved via cherry-pick).
Behavior today is unchanged: the static effort lists cap at
high, so nothing currently reportsxhighas supported. The fix removes the silent cap so the moment live catalog resolution (#51953) supplies richer per-model sets, higher levels are honored automatically.Changes
plugins/model-providers/copilot/__init__.py: replace the unconditional{xhigh,max,ultra}→highmap with membership-driven nearest-down clamping (@AlsayedHoota, @arminanton)run_agent.py_github_models_reasoning_extra_body: same fix on the core GitHub Responses path — downgradexhighonly when the supported set lacks it (@arminanton)tests/plugins/model_providers/test_copilot_profile.py(new) +tests/run_agent/test_run_agent.py: pins the contract on both request paths with a stubbed catalog (@hydraxman)scripts/release.py: AUTHOR_MAP entry for the test commit's bare-noreply git identityValidation
xhighxhighhigh(silent cap)xhighxhighhighhighhighminimalminimallow(nearest-down)Targeted:
test_copilot_profile.py+test_run_agent.py— 438 passed.Closes #62028. Refs #51953 (live catalog resolution — separate review), #52384.
Infographic