Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 26, 2025

Related GitHub Issue

Closes: #10312

Roo Code Task Context (Optional)

This PR was created by Roomote to address the issue raised about XML tool calling deprecation.

Description

This PR attempts to address Issue #10312 by restoring the ability for users to explicitly set XML tool protocol for providers that may benefit from it.

Key changes:

  • Modified resolveToolProtocol() to respect user toolProtocol preference for specific providers:
    • LiteLLM: Proxies to various LLM backends, some may not support native tools
    • OpenAI Compatible: Custom endpoints with varying tool support
    • Ollama: Local models may have limited native tool support
    • LM Studio: Local models may have limited native tool support

How it works:

  1. Locked Protocol still takes highest priority (for resumed tasks)
  2. For the specific providers listed above, user preference for XML is now respected
  3. All other providers default to Native tool calling

This allows users to work around compatibility issues like the one reported with LiteLLM and HarmonyParser where native tool calling caused internal server errors.

Test Procedure

  1. All existing tests updated to reflect new behavior
  2. Added new test cases for XML fallback providers
  3. Run tests: cd src && npx vitest run utils/__tests__/resolveToolProtocol.spec.ts
  4. All 36 tests pass

Manual testing:

  1. Configure a profile with LiteLLM/Ollama/LMStudio/OpenAI compatible provider
  2. Set toolProtocol: "xml" in the profile settings
  3. Verify that XML tool protocol is used instead of native

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 - Backend logic change only, no UI changes.

Documentation Updates

  • No documentation updates are required.

The existing toolProtocol setting in profile configuration now works for the specified providers. Users can set this via their profile settings.

Additional Notes

Feedback and guidance are welcome. This change is intentionally conservative, only enabling the XML fallback for providers where it makes sense (proxies and local model providers).

Get in Touch

Roomote Bot

This change allows users to explicitly set XML tool protocol for
providers that may benefit from it:

- LiteLLM: Proxies to various LLM backends, some may not support native tools
- OpenAI Compatible: Custom endpoints with varying tool support
- Ollama: Local models may have limited native tool support
- LM Studio: Local models may have limited native tool support

This addresses compatibility issues like the one reported with LiteLLM
and HarmonyParser where native tool calling caused internal server errors.

Users can now configure toolProtocol: "xml" in their profile settings
for these providers to work around such issues.

Fixes #10312
@roomote
Copy link
Contributor Author

roomote bot commented Dec 26, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly allows users to explicitly set XML tool protocol for specific providers (LiteLLM, OpenAI Compatible, Ollama, LM Studio) while maintaining Native as the default. The precedence logic is sound, tests are comprehensive (36 tests pass), and the change addresses issue #10312.

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 26, 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

Development

Successfully merging this pull request may close these issues.

[BUG] Tool calling (XML) should be kept available! Proper regression testing required.

3 participants