Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 13, 2026

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_choice parameter, causing 400 errors.

Solution: Added a new boolean setting openAiOmitToolChoice that allows users to optionally omit the tool_choice parameter from API requests.

Changes:

  1. Added openAiOmitToolChoice: z.boolean().optional() to the openAiSchema in packages/types/src/provider-settings.ts
  2. Modified src/api/providers/openai.ts to check for this.options.openAiOmitToolChoice before including tool_choice in requests (4 locations)
  3. Added checkbox UI in webview-ui/src/components/settings/providers/OpenAICompatible.tsx for users to enable this setting
  4. Added English translations for the new setting labels

Key implementation details:

  • Backward compatible: default behavior unchanged (tool_choice is included unless explicitly disabled)
  • Works for any Azure/LiteLLM configuration that does not support tool_choice

Test Procedure

  1. All existing OpenAI provider tests pass (48 tests)
  2. TypeScript compilation passes without errors
  3. Lint checks pass
  4. Manual testing: Enable the checkbox when using Azure-hosted models via OpenAI Compatible provider to prevent 400 errors related to tool_choice

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.

Screenshots / Videos

N/A - Settings checkbox UI follows existing patterns in the codebase.

Documentation Updates

  • No documentation updates are required.

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 openAiOmitToolChoice setting to optionally omit tool_choice parameter for Azure/LiteLLM compatibility, with UI and API updates.

  • Behavior:
    • Adds openAiOmitToolChoice boolean setting to openAiSchema in provider-settings.ts to optionally omit tool_choice parameter.
    • Updates OpenAiHandler in openai.ts to check openAiOmitToolChoice before including tool_choice in API requests (4 locations).
    • Adds checkbox in OpenAICompatible.tsx for users to enable/disable this setting.
  • UI:
    • Adds English translations for new setting labels in settings.json.
  • Compatibility:
    • Default behavior unchanged; tool_choice included unless openAiOmitToolChoice is enabled.
    • Supports Azure/LiteLLM configurations that do not support tool_choice.

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

Add a new boolean setting that allows users to omit the tool_choice
parameter from OpenAI API requests. This fixes compatibility issues
with Azure-hosted models and LiteLLM proxies that do not support
the tool_choice parameter.

Fixes #10701
@roomote
Copy link
Contributor Author

roomote bot commented Jan 13, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly adds the openAiOmitToolChoice setting to allow users to omit the tool_choice parameter for Azure/LiteLLM compatibility. The changes are well-structured, backward compatible, and follow existing codebase patterns.

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