Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 23, 2025

Related GitHub Issue

Closes: #10246

Description

This PR attempts to address Issue #10246 where users with third-party API providers (OpenAI Compatible) are unable to switch between Native and XML tool protocols after the XML protocol was deprecated in PR #10281.

The Problem:
PR #10281 removed the Tool Protocol selector from the UI and forced all providers to use Native tool calling. However, many third-party API proxies do not fully support native tool calling, causing errors like:

  • "The model provided text/reasoning but did not call any required tools"
  • JSON Schema validation errors

The Solution:
This PR re-adds the Tool Protocol selector specifically for OpenAI Compatible providers, allowing users to manually select XML protocol as a workaround when their third-party proxy does not support native tool calling.

Changes:

  • Added Tool Protocol selector to OpenAICompatible.tsx
  • Updated resolveToolProtocol() to respect user preference for openai provider
  • Added tests for OpenAI Compatible provider tool protocol selection

Behavior:

Provider User Preference Result
OpenAI Compatible XML Uses XML protocol
OpenAI Compatible Native Uses Native protocol
OpenAI Compatible Not set Uses Native (default)
Other providers Any Always uses Native
Resumed tasks Any Uses locked protocol

Test Procedure

  1. Run unit tests: cd src && npx vitest run utils/__tests__/resolveToolProtocol.spec.ts
  2. TypeScript checks: cd src && npx tsc --noEmit --skipLibCheck
  3. TypeScript checks (webview): cd webview-ui && npx tsc --noEmit --skipLibCheck

Manual testing:

  1. Select OpenAI Compatible provider
  2. Verify Tool Protocol selector is visible in the settings
  3. Select XML protocol and verify tool calls use XML format
  4. Select Native protocol and verify tool calls use native format

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!

Re-adds the Tool Protocol selector for OpenAI Compatible providers that
was removed in PR #10281. This allows users with third-party API proxies
to select XML protocol as a workaround when their provider does not fully
support native tool calling.

Changes:
- Add Tool Protocol selector to OpenAICompatible.tsx
- Update resolveToolProtocol() to respect user preference for openai provider
- Add tests for OpenAI Compatible provider tool protocol selection

Fixes #10246
@roomote
Copy link
Contributor Author

roomote bot commented Dec 23, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. No issues found.

Summary:

  • Type consistency verified - toolProtocol field properly typed
  • i18n translations exist for all used keys
  • Logic correctly implements precedence order (locked > user preference for openai > native default)
  • Test coverage is comprehensive
  • UI component properly handles value mapping

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

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

3 participants