Skip to content

fix: use model reasoning definitions and defaults when Copilot is used via OpenRouter - #335276

Merged
Vritant Bhardwaj (vritant24) merged 2 commits into
microsoft:mainfrom
KKKayleX:fix/openRouter-thinking-efforts-list
Sep 28, 2026
Merged

Vritant Bhardwaj (vritant24) merged 2 commits into
microsoft:mainfrom
KKKayleX:fix/openRouter-thinking-efforts-list

Conversation

@KKKayleX

@KKKayleX KKKayleX commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #332152

As a result:

  • Models that support extra effort tiers (e.g. xhigh, max) never surfaced
    them in the Thinking Effort picker — only low/medium/high were offered.
  • The picker's default was derived from pickDefaultReasoningEffort (e.g.
    medium) instead of the model's own reasoning.default_effort.

Changes

In extensions/copilot/src/extension/byok/vscode-node/openRouterProvider.ts:

  • Derive the supported effort list from reasoning.supported_efforts, falling
    back to ['low','medium','high'] when the model omits it, instead of always
    hard-coding that list.
  • Forward reasoning.default_effort into the capabilities'
    defaultReasoningEffort so the picker can pre-select it.

Copilot AI balanced review requested due to automatic review settings September 9, 2026 14:54
@KKKayleX

KKKayleX commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

KKKayleX please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The OpenRouter response type incorrectly requires a field that the implementation explicitly supports being omitted.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates OpenRouter model discovery to honor provider-defined reasoning effort levels and defaults.

Changes:

  • Uses reasoning.supported_efforts with a standard fallback.
  • Propagates reasoning.default_effort.
  • Adds focused regression tests.
File summaries
File Description
openRouterProvider.ts Maps OpenRouter reasoning metadata into model capabilities.
test/openRouterProvider.spec.ts Tests supported efforts, fallbacks, and defaults.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread extensions/copilot/src/extension/byok/vscode-node/openRouterProvider.ts Outdated
Comment thread extensions/copilot/src/extension/byok/vscode-node/test/openRouterProvider.spec.ts Outdated
@aiday-mar Aiday Marlen Kyzy (aiday-mar) removed their assignment Sep 11, 2026
@KKKayleX KKKayleX changed the title Honor OpenRouter model reasoning definitions and defaults fix: use model reasoning definitions and defaults when Copilot is used via OpenRouter Sep 14, 2026
@KKKayleX

Copy link
Copy Markdown
Contributor Author

Since #335272 was closed as a duplicate of #332152, this PR tracks #332152 instead.

This PR removes the hard-coded reasoning effort list and propagates reasoning.default_effort from OpenRouter model metadata.

Dmitriy Vasyura (@dmitrivMS) Vritant Bhardwaj (@vritant24)

@vritant24
Vritant Bhardwaj (vritant24) merged commit 9ae5e96 into microsoft:main Sep 28, 2026
33 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.140.0 milestone Sep 28, 2026
@KKKayleX

Copy link
Copy Markdown
Contributor Author

Thanks so much 🙏

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.

OpenRouter provider hardcodes reasoning efforts in copilot extension

6 participants