Skip to content

fix(core): preserve strict in FunctionTool component config - #8284

Open
yc2bgr8 (yc2bgr8) wants to merge 1 commit into
microsoft:mainfrom
yc2bgr8:fix/function-tool-preserve-strict
Open

yc2bgr8 (yc2bgr8) wants to merge 1 commit into
microsoft:mainfrom
yc2bgr8:fix/function-tool-preserve-strict

Conversation

@yc2bgr8

Copy link
Copy Markdown

Why are these changes needed?

FunctionTool(strict=True) currently loses its strict setting when it is serialized with dump_component() and restored with load_component(). This silently changes the generated tool schema to strict=False, even though strict tools are required when they are used with structured output.

This change persists strict in the component configuration and passes it back into the restored tool. The config field defaults to False so component configs produced by earlier AutoGen versions remain loadable with their existing behavior.

Regression coverage verifies both the strict=True round trip and the legacy-config fallback. Before the fix, the new test failed because the dumped config had no strict key. Local validation completed with 21 component-config tests and all 227 autogen-core tests passing, plus Ruff, Mypy, and Pyright.

Related issue number

Closes #8283

Checks

  • I've included any doc changes needed for https://microsoft.github.io/autogen/. No documentation changes are needed because this restores the existing strict constructor behavior across component serialization.
  • I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • I've made sure all auto checks have passed. Local package checks pass; GitHub checks will run after submission.

@yc2bgr8

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FunctionTool(strict=True) loses strict across dump_component / load_component

1 participant