feat: add openAiOmitToolChoice setting for Azure/LiteLLM compatibility #10704
+21
−4
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.
Related GitHub Issue
Closes: #10701
Roo Code Task Context (Optional)
N/A
Description
This PR attempts to address Issue #10701. Feedback and guidance are welcome.
Problem: Azure-hosted models (like GPT-5) accessed through LiteLLM proxies do not support the
tool_choiceparameter, causing 400 errors.Solution: Added a new boolean setting
openAiOmitToolChoicethat allows users to optionally omit thetool_choiceparameter from API requests.Changes:
openAiOmitToolChoice: z.boolean().optional()to theopenAiSchemainpackages/types/src/provider-settings.tssrc/api/providers/openai.tsto check forthis.options.openAiOmitToolChoicebefore includingtool_choicein requests (4 locations)webview-ui/src/components/settings/providers/OpenAICompatible.tsxfor users to enable this settingKey implementation details:
tool_choiceTest Procedure
tool_choicePre-Submission Checklist
Screenshots / Videos
N/A - Settings checkbox UI follows existing patterns in the codebase.
Documentation Updates
Additional Notes
The setting is added in the OpenAI Compatible provider settings, near the "Use Azure" checkbox, as it is related to Azure compatibility issues.
Get in Touch
N/A - Automated PR by Roomote
Important
Adds
openAiOmitToolChoicesetting to optionally omittool_choiceparameter for Azure/LiteLLM compatibility, with UI and API updates.openAiOmitToolChoiceboolean setting toopenAiSchemainprovider-settings.tsto optionally omittool_choiceparameter.OpenAiHandlerinopenai.tsto checkopenAiOmitToolChoicebefore includingtool_choicein API requests (4 locations).OpenAICompatible.tsxfor users to enable/disable this setting.settings.json.tool_choiceincluded unlessopenAiOmitToolChoiceis enabled.tool_choice.This description was created by
for 1b56f5e. You can customize this summary. It will automatically update as commits are pushed.