Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rayss868
Copy link

Context

This PR fixes a bug where reasoning_effort settings were not correctly synchronized or sent when using the OpenAI Compatible provider. Previously, users had to switch to the OpenAI Native provider to save these settings before they would work in the Compatible provider. This change ensures a seamless experience for custom API endpoints that support reasoning (like OpenRouter or local O1-compatible servers).

Implementation

  1. UI Synchronization: Modified OpenAICompatible.tsx to ensure that when a user selects a reasoning level, it is saved both in the model's custom info and at the root level of the configuration.
  2. State Cleanup: Added logic to remove reasoning parameters when the feature is toggled off, preventing stale data from being sent to the API.
  3. Backend Enhancement: Updated BaseOpenAiCompatibleProvider.ts to detect the reasoning_effort parameter from the settings and include it in the outgoing API payload.
  4. Consistency: Aligned the data flow of OpenAI Compatible with the Native OpenAI provider for better maintainability.

Try It

before after
Reasoning level was ignored or required a provider-switch workaround. Reasoning level is saved instantly and sent correctly to the API.

How to Test

  1. Go to Settings and select OpenAI Compatible as the provider.
  2. Enter your custom Base URL and API Key.
  3. Enable "Set Reasoning Level".
  4. Select "Low" (or any other level) and click Save.
  5. Start a new task and verify (via logs or API inspector) that the reasoning_effort parameter is included in the request.
  6. Toggle it off, save, and verify the parameter is no longer sent.

Get in Touch

If you have any questions, feel free to reach out!

- Updated OpenAICompatible UI component to synchronize reasoningEffort between the root API configuration and openAiCustomModelInfo.

- Added logic to clear reasoningEffort when the reasoning toggle is disabled to prevent configuration conflicts.

- Enhanced BaseOpenAiCompatibleProvider to explicitly send the reasoning_effort parameter (low, medium, high) in API requests if the model supports it.

-Fixed an issue where reasoning settings would only persist after switching to the OpenAI Native provider and back.
@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

⚠️ No Changeset found

Latest commit: 259a742

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Jan 28, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

This PR correctly addresses a synchronization issue between the UI state and backend configuration for reasoning effort in OpenAI-compatible providers.

Key changes:

  1. Backend (base-openai-compatible-provider.ts): Added support for reasoning_effort parameter alongside the existing thinking parameter, allowing models that support effort levels (low/medium/high/xhigh) to use them
  2. Frontend (OpenAICompatible.tsx): Fixed state synchronization to ensure reasoningEffort is stored both in openAiCustomModelInfo and at the top-level apiConfiguration, which the backend reads from

The implementation correctly:

  • Separates binary thinking mode (supportsReasoningBinary) from effort-level mode (supportsReasoningEffort)
  • Clears the reasoning effort when the feature is disabled
  • Uses proper fallback logic (user preference β†’ model default)
Files Reviewed (2 files)
  • src/api/providers/base-openai-compatible-provider.ts - reasoning effort parameter support
  • webview-ui/src/components/settings/providers/OpenAICompatible.tsx - state synchronization fix

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