fix(core): preserve strict in FunctionTool component config - #8284
Open
yc2bgr8 (yc2bgr8) wants to merge 1 commit into
Open
yc2bgr8 (yc2bgr8) wants to merge 1 commit into
yc2bgr8 (yc2bgr8) wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
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.
Why are these changes needed?
FunctionTool(strict=True)currently loses its strict setting when it is serialized withdump_component()and restored withload_component(). This silently changes the generated tool schema tostrict=False, even though strict tools are required when they are used with structured output.This change persists
strictin the component configuration and passes it back into the restored tool. The config field defaults toFalseso component configs produced by earlier AutoGen versions remain loadable with their existing behavior.Regression coverage verifies both the
strict=Trueround trip and the legacy-config fallback. Before the fix, the new test failed because the dumped config had nostrictkey. Local validation completed with 21 component-config tests and all 227autogen-coretests passing, plus Ruff, Mypy, and Pyright.Related issue number
Closes #8283
Checks
strictconstructor behavior across component serialization.