feat: restore XML tool protocol option for compatible providers #10348
+158
−36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
resolveToolProtocol()to respect usertoolProtocolpreference for specific providers:How it works:
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
cd src && npx vitest run utils/__tests__/resolveToolProtocol.spec.tsManual testing:
toolProtocol: "xml"in the profile settingsPre-Submission Checklist
Screenshots / Videos
N/A - Backend logic change only, no UI changes.
Documentation Updates
The existing
toolProtocolsetting 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