Python: Respect FunctionChoiceBehavior filters in OpenAI responses agent tools#13235
Merged
moonbox3 merged 6 commits intomicrosoft:mainfrom Apr 8, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that FunctionChoiceBehavior filters are properly respected when retrieving kernel function metadata in OpenAI responses agent tools. Previously, the code was ignoring these filters and always returning all available functions.
- Replaced the TODO comment with proper implementation of FunctionChoiceBehavior filter handling
- Added early returns for cases where kernel functions are disabled or no plugins exist
- Used conditional logic to apply filters when retrieving function metadata
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py
Outdated
Show resolved
Hide resolved
python/semantic_kernel/agents/open_ai/responses_agent_thread_actions.py
Outdated
Show resolved
Hide resolved
1b57d35 to
30d70c1
Compare
moonbox3
approved these changes
Oct 17, 2025
Collaborator
|
@ymuichiro Thanks for the contribution. Please have a look at a failing test, thanks: https://github.com/microsoft/semantic-kernel/actions/runs/18583595889/job/52983055182?pr=13235#step:5:445 |
…ict in Responses agent
….com/ymuichiro/semantic-kernel into feat/respect-function-choice-filters
Contributor
Author
|
@moonbox3 |
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
dmytrostruk
approved these changes
Oct 23, 2025
shethaadit
approved these changes
Nov 12, 2025
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.
issue: #13234
Summary
Contribution Checklist