Skip to content

Python: fix(functions): validate complex kernel function arguments - #14466

Open
Adil Alperen Çiftci (adilalperenciftci) wants to merge 4 commits into
microsoft:mainfrom
adilalperenciftci:fix/validate-complex-kernel-arguments
Open

Adil Alperen Çiftci (adilalperenciftci) wants to merge 4 commits into
microsoft:mainfrom
adilalperenciftci:fix/validate-complex-kernel-arguments

Conversation

@adilalperenciftci

Copy link
Copy Markdown

Summary

Complex and Union annotations containing commas could bypass parameter parsing in gather_function_parameters, allowing raw argument values to reach the kernel function.

Changes

  • Validated generic and union annotations with Pydantic TypeAdapter.
  • Removed the condition "," not in param.type_ that skipped parsing for comma-containing type metadata.
  • Added regression test covering invalid union argument handling.

Complex and Union annotations containing commas could bypass parameter parsing in gather_function_parameters, allowing raw argument values to reach the kernel function. Validate generic annotations with Pydantic TypeAdapter and remove the condition that skipped parsing for comma-containing type metadata.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

… empty

Preserve PEP 604 and typing.Union type metadata during kernel function
parameter inspection when unions do not contain NoneType.
@semantic-kernel-automation semantic-kernel-automation Bot added the python Pull requests for the Python Semantic Kernel label Oct 10, 2026
@github-actions github-actions Bot changed the title fix(functions): validate complex kernel function arguments Python: fix(functions): validate complex kernel function arguments Oct 10, 2026
Signed-off-by: Adil Alperen Çiftci <adilerta54@gmail.com>
@adilalperenciftci

Copy link
Copy Markdown
Author

Updated the branch to current main. The focused validation suite passes 43 tests; Ruff check and formatting checks are also clean. Could a maintainer approve the workflows and take a first look at the new head?

This branch was previously deployed

1 inactive deployment
github-app-auth — fe54fc7d Deployed Oct 20, 2026 by adilalperenciftci via add_label #29392
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants