fix(reflect): preserve required tools for custom OpenAI endpoints#2734
Open
Jordan-Jarvis wants to merge 3 commits into
Open
Conversation
…penai-required-tool-choice-20260716
Contributor
Author
|
Merged current upstream Validation on the updated head:
|
Contributor
Author
|
@benfrank241 @dcbouius could one of you review this custom-endpoint tool-choice fix? The branch is current, clean, mergeable, and green, with focused coverage confirming required tools are preserved instead of being silently downgraded. The dependent typed cutover remains draft until this lands. |
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
tool_choice="required"for generic OpenAI-compatible endpoints that use a custom base URLWhy
A custom URL does not identify an endpoint's tool-choice capabilities. The current blanket classification changes a named forced choice into an effectively automatic request. In a multi-turn Reflect loop, that can make the endpoint select a transcript-dependent tool that was removed when Hindsight narrowed the tool list, causing a valid request sequence to fail.
OpenAI-compatible endpoints that implement the contract should receive the caller's required-tool semantics. Nonconforming implementations should use an explicitly identified provider path rather than being inferred from URL presence.
Validation