Repository navigation
ποΈ fix: Forward Client tool_choice and parallel_tool_calls When Binding Tools - #734
Merged
Merged
Conversation
β¦Tools ChatOpenAI reads tool_choice and parallel_tool_calls only from call options, so values hosts set on OpenAI-compatible client options (for example LibreChat custom endpoint addParams) never reached the request. initializeModel now passes them to bindTools for OpenAI-like providers. Disabled tool calling keeps tool_choice none, tool-less calls are unchanged, and other provider families keep their current binding.
Codex Review Summary: β CompletedThis comment shows the latest Codex review activity on this pull request.
βΉοΈ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with π while any review is running, comments if it has suggestions, and reacts with π once all reviews finish with no findings. |
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ChatOpenAIonly readstool_choiceandparallel_tool_callsfrom call options, never from constructor fields.initializeModelbound tools withbindTools(tools)and no options, so a host that set either value on OpenAI-compatible client options (LibreChat custom endpointaddParams) got a request without them, silently.initializeModelnow forwards both values tobindToolsfor OpenAI-like providers when tools are bound. Disabled tool calling (summaries) still sendstool_choice: 'none'and nothing else, so a configuredrequiredcannot override it. Tool-less calls (titles, labels) are unchanged, other provider families keep their current binding, and malformed values are ignored.Related to LibreChat-AI/LibreChat#17154. LibreChat picks this up through a dependency bump after the next release.
Change Type
Testing
npx jest src/llm/init.test.ts: 16 passed. The two forwarding cases fail onmain(both fields absent from the captured request body) and pass here; the disabled-tool-calling, tool-less, and malformed cases pass on both.reviewctl precheck --local: typecheck, sort-imports, eslint, and the related Jest suites (2411 tests) pass.src/llm/anthropic/llm.spec.tsneeds a live Anthropic key and was not run.Checklist