Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 13, 2026

Related GitHub Issue

Closes: #10701

Description

This PR attempts to address Issue #10701 by adding a new openAiOmitToolChoice setting to the OpenAI provider schema.

Changes:

  • Added openAiOmitToolChoice: z.boolean().optional() to the openAiSchema in packages/types/src/provider-settings.ts
  • Modified src/api/providers/openai.ts to check for this setting before including tool_choice in API requests (in all 4 places where tool_choice is used)
  • Added a checkbox UI control in webview-ui/src/components/settings/providers/OpenAICompatible.tsx
  • Added localization strings in webview-ui/src/i18n/locales/en/settings.json

When enabled, the setting will omit the tool_choice parameter from API requests, allowing users with Azure-hosted models (like GPT-5) accessed through LiteLLM proxies to avoid 400 errors.

Test Procedure

  1. Configure an OpenAI-compatible provider with an Azure/LiteLLM endpoint that does not support tool_choice
  2. Enable the "Omit tool_choice parameter" checkbox in provider settings
  3. Send a request - it should now succeed without the 400 error about unsupported parameters

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

Feedback and guidance are welcome!


Important

Adds openAiOmitToolChoice setting to omit tool_choice parameter for Azure/LiteLLM compatibility, with changes in API handling, UI, and localization.

  • Behavior:
    • Adds openAiOmitToolChoice to openAiSchema in provider-settings.ts to optionally omit tool_choice in API requests.
    • Updates OpenAiHandler in openai.ts to check openAiOmitToolChoice before including tool_choice in requests.
  • UI:
    • Adds checkbox for "Omit tool_choice parameter" in OpenAICompatible.tsx.
  • Localization:
    • Adds strings for "omitToolChoice" and "omitToolChoiceTips" in settings.json.

This description was created by Ellipsis for b292902. You can customize this summary. It will automatically update as commits are pushed.

…ility

Adds openAiOmitToolChoice setting to the OpenAI provider that allows users
to optionally omit the tool_choice parameter from API requests. This
resolves 400 errors when using Azure-hosted models (like GPT-5) through
LiteLLM proxies that do not support the tool_choice parameter.

Closes: #10701
@roomote
Copy link
Contributor Author

roomote bot commented Jan 13, 2026

Rooviewer Clock   See task on Roo Cloud

Reviewed all changes. No issues found.

The implementation correctly adds the openAiOmitToolChoice setting to conditionally omit the tool_choice parameter from API requests for Azure/LiteLLM compatibility. The changes are consistent with existing patterns and backward compatible.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] azure does not support parameters: ['tool_choice']

2 participants