-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: restore XML tool protocol option for OpenAI-Compatible provider #10347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This restores the ability for users of the OpenAI-Compatible provider to
explicitly select XML tool protocol, fixing compatibility issues with
backends like SGLang/vLLM that do not support native tool calling.
Changes:
- Modified resolveToolProtocol.ts to respect user toolProtocol preference
for the OpenAI-Compatible provider ("openai")
- Added Tool Protocol selector to OpenAICompatible.tsx component
- Added tests for the new behavior in resolveToolProtocol.spec.ts
- Updated OpenAICompatible.spec.tsx to mock Select components
Fixes #10319
Review complete. No issues found. This PR correctly restores the XML tool protocol option for the OpenAI-Compatible provider by:
The implementation is clean and well-tested. Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
PR marked as ready for review. All tests pass (40 tests total across backend and UI). |
Review complete. No issues found. This PR correctly restores the XML tool protocol option for the OpenAI-Compatible provider by:
The implementation is clean and well-tested. Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
This PR attempts to address Issue #10319 by restoring the ability for users of the OpenAI-Compatible provider to explicitly select XML tool protocol.
Problem
In v3.37+, the Tool Call Protocol selector was removed and all new tasks are forced to use native tool calling. This breaks users with OpenAI-Compatible endpoints backed by servers like SGLang or vLLM that do not support native tool calling (e.g., HarmonyParser throws
NotImplementedError: structure_info not used with HarmonyParser).Solution
This PR:
resolveToolProtocol.tsto respect the user'stoolProtocolpreference when using the OpenAI-Compatible provider (apiProvider === "openai")OpenAICompatible.tsxPrecedence Logic
The updated
resolveToolProtocol()function now follows this precedence:toolProtocolsetting only forapiProvider: "openai")This approach:
Feedback and guidance are welcome.
Important
Restores XML tool protocol option for OpenAI-Compatible provider, adds UI selector, and updates tests.
resolveToolProtocol.ts.OpenAICompatible.tsx.resolveToolProtocol.spec.tsandOpenAICompatible.spec.tsx.resolveToolProtocol()now respects user preference for XML protocol for OpenAI-Compatible provider.OpenAICompatible.tsx.This description was created by
for 89fd5a6. You can customize this summary. It will automatically update as commits are pushed.