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!


Important

Reintroduces tool protocol selector for OpenAI Compatible providers, allowing XML or Native protocol selection based on user preference.

  • Behavior:
    • Re-adds Tool Protocol selector in OpenAICompatible.tsx for OpenAI Compatible providers.
    • Updates resolveToolProtocol() to respect user preferences for OpenAI Compatible providers.
    • Defaults to Native protocol for other providers and new tasks.
  • Tests:
    • Adds tests in resolveToolProtocol.spec.ts for OpenAI Compatible provider tool protocol selection.
    • Tests cover user preference handling and default behavior.
  • UI:
    • Adds a dropdown in OpenAICompatible.tsx to select tool protocol (XML or Native).

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

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
@chan1919
Copy link

chan1919 commented Jan 6, 2026

Please solve this bug fastly.
@roomote

@roomote
Copy link
Contributor Author

roomote bot commented Jan 6, 2026

Fixaroo Clock   See task on Roo Cloud

Verified PR is complete and ready for review. All local checks passed (30 tests, TypeScript checks). Marked PR as ready for review.

View PR | View commit | Revert commit

@roomote roomote bot marked this pull request as ready for review January 6, 2026 09:22
@roomote roomote bot requested review from cte, jr and mrubens as code owners January 6, 2026 09:22
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jan 6, 2026
@chan1919
Copy link

chan1919 commented Jan 6, 2026

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

PLZ fix this error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@roomote
Copy link
Contributor Author

roomote bot commented Jan 6, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The PR correctly restores the Tool Protocol selector for OpenAI Compatible providers, addressing issue #10246. The implementation is type-safe, well-tested, and all i18n translations are in place.

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

@chan1919
Copy link

chan1919 commented Jan 7, 2026

This PR fixing so slow

@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 7, 2026
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jan 7, 2026
@hannesrudolph
Copy link
Collaborator

This PR fixing so slow

https://blog.roocode.com/p/sorry-we-didnt-listen-sooner-native

Some people have asked why we did not keep XML as an option. Keeping two tool calling architectures massively increases complexity. Every fix, every feature, every tool-related issue forces Roo to reason about two completely different execution paths. That slows development, increases bugs, and makes it harder to move Roo forward. It also guarantees that XML users would slowly get stuck with an increasingly outdated experience as improvements land only in the native path.

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

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Done

4 participants