-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Add Reasoning Effort setting for OpenAI Compatible provider #2906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Reasoning Effort setting for OpenAI Compatible provider #2906
Conversation
🦋 Changeset detectedLatest commit: c2c8075 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The changes in this pull request are cohesive and related to the addition of the "Reasoning Effort" feature for the OpenAI Compatible provider. Therefore, it does not need to be split into smaller pull requests. The changes include updates to settings, tests, and UI components, all of which are part of implementing this new feature. |
eecd314 to
25fcad6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made changes to this, but now that I think about it, i did not regression test the one other use case that was already using it, but all the unit tests pass, so I am relying on those passing to ensure I didn't cause any regressions
I did not test this usage:
{REASONING_MODELS.has(selectedModelId) && (
<ReasoningEffort
apiConfiguration={apiConfiguration}
setApiConfigurationField={setApiConfigurationField}
/>
)}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if other languages' translations are required prior to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice. We get around to it eventually. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I used AI to add the missing translations to the various internationalization files
|
Thanks for the great description! |
25fcad6 to
5cb8f16
Compare
|
Looking into the failing unit tests, will update the PR Update: all tests passing now |
5cb8f16 to
e8efe1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this in order to get it to pass the windows extension tests, otherwise this change is not related to the core functionality I added
e8efe1f to
4ee6a29
Compare
|
Nice! This looks pretty good to me. I'll test it out and merge if everything looks 👌 |
9872ade to
f860a42
Compare
f860a42 to
04f5332
Compare
|
@cte mind checking this today so we can get it into the release? Thank you! |
|
@mr-ryan-james are you on discord? |
|
@hannesrudolph Yes, I am on Discord. My username is ryan.james |
Summary
This PR introduces the "Enable Reasoning Effort" setting specifically for the "OpenAI Compatible" provider configuration.
Motivation
Some OpenAI-compatible endpoints (ie Azure) support a
reasoning_effortparameter to influence model behavior, potentially affecting response quality, latency, and cost. This setting was missing for the generic "OpenAI Compatible" provider, limiting user control when interacting with such endpoints through Roo-Code. I found this particularly useful for my own workflows.Changes
ReasoningEffortcomponent) to the "OpenAI Compatible" provider settings section inwebview-ui/src/components/settings/ApiOptions.tsx.ReasoningEffortdropdown is only shown when the checkbox is enabled.low,medium,high,auto) is stored inapiConfiguration.openAiCustomModelInfo.reasoningEffort.reasoningEffortproperty is explicitly removed fromapiConfiguration.openAiCustomModelInfoto ensure no parameter is sent.OpenAiHandler(src/api/providers/openai.ts) now reads this setting and includes thereasoning_effortparameter in the API request payload only ifenableReasoningEffortis true and a value is set.webview-ui/src/components/settings/__tests__/ApiOptions.test.tsxto verify the checkbox and dropdown logic updates the configuration state correctly.src/api/providers/__tests__/openai.test.tsto verify that thereasoning_effortparameter is correctly included or excluded from the mocked API request payload based on the configuration.Impact for Users
reasoning_effortparameter will not be sent.All tests pass.
Important
Add "Enable Reasoning Effort" setting to OpenAI Compatible provider, with UI, logic, and tests for handling the parameter.
ReasoningEffortdropdown to OpenAI Compatible provider settings inApiOptions.tsx.ReasoningEffortdropdown appears only when checkbox is checked.apiConfiguration.openAiCustomModelInfo.reasoningEffort.reasoningEffortfromapiConfiguration.openAiCustomModelInfo.OpenAiHandlerinopenai.tsincludesreasoning_effortin API request if enabled.ApiOptions.test.tsxfor checkbox and dropdown logic.openai.test.tsfor API request payload validation.This description was created by
for eecd314f33c2ad753b25596324e1bfc24dccaa99. You can customize this summary. It will automatically update as commits are pushed.