fix: restore tool protocol selector for OpenAI Compatible provider #10300
+98
−13
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: #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 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:
resolveToolProtocol()to respect user preference for openai providerBehavior:
Test Procedure
cd src && npx vitest run utils/__tests__/resolveToolProtocol.spec.tscd src && npx tsc --noEmit --skipLibCheckcd webview-ui && npx tsc --noEmit --skipLibCheckManual testing:
Pre-Submission Checklist
Documentation Updates
Additional Notes
Feedback and guidance are welcome!