Skip to content

feat: add Copilot reasoning effort picker support for OpenRouter#262

Open
nicolalazzaro wants to merge 1 commit into
JohnnyZ93:mainfrom
nicolalazzaro:feature/openrouter-reasoning-effort-picker
Open

feat: add Copilot reasoning effort picker support for OpenRouter#262
nicolalazzaro wants to merge 1 commit into
JohnnyZ93:mainfrom
nicolalazzaro:feature/openrouter-reasoning-effort-picker

Conversation

@nicolalazzaro
Copy link
Copy Markdown

Summary

This PR extends the Copilot Reasoning Effort picker support to OpenRouter-compatible models.

Following the implementation in #237 for OpenAI-compatible models, this PR allows users to temporarily override the reasoning effort for a single request when using OpenRouter models.

Behavior

  • If reasoning.effort is unset or empty:

    • the model is registered normally;
    • no Copilot reasoning effort picker is shown.
  • If reasoning.effort is set to a supported value:

    • the model is registered with a Copilot configurationSchema;
    • the Copilot chat input shows a Reasoning Effort picker;
    • the configured reasoning.effort value is used as the picker default.
  • If the user changes the picker value in Copilot:

    • that temporary selection is used for the current request.
  • If Copilot does not pass a temporary picker value:

    • the configured model-level reasoning.effort is used as the fallback.

Implementation

  • Added isOpenRouterReasoningEffortPickerEnabled helper in src/modelConfiguration.ts.
  • Updated prepareLanguageModelChatInformation in src/provideModel.ts to register the configurationSchema for OpenRouter models.
  • Updated OpenaiApi in src/openai/openaiApi.ts to apply the selected reasoning effort to the reasoning.effort field in the OpenRouter request body.
  • Updated the configuration UI in assets/configView/configView.html to clarify that leaving the Reasoning Effort field empty hides the Copilot picker.
  • Added tests in src/test/modelConfiguration.test.ts to verify the new functionality.

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.

1 participant