Python: Remove unsupported as_agent function_invocation_configuration#6520
Open
eavanvalkenburg wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses #6313 by removing the unsupported function_invocation_configuration kwarg from the Python BaseChatClient.as_agent() public API, ensuring callers fail immediately at the correct boundary instead of later via an internal Agent.__init__() error.
Changes:
- Removed the
function_invocation_configurationparameter (and related forwarding) fromBaseChatClient.as_agent(). - Added a regression test asserting
as_agent(function_invocation_configuration=...)raisesTypeErrorwith the expected “unexpected keyword argument” message.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/packages/core/agent_framework/_clients.py | Removes unsupported function_invocation_configuration from BaseChatClient.as_agent() signature/docs and stops forwarding it into Agent(**kwargs). |
| python/packages/core/tests/core/test_clients.py | Adds a regression test ensuring as_agent() rejects the removed kwarg at the public API boundary. |
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
TaoChenOSU
approved these changes
Jun 15, 2026
moonbox3
approved these changes
Jun 16, 2026
96aa46c to
e66a5e6
Compare
Fixes microsoft#6313 Remove the unsupported function_invocation_configuration parameter from BaseChatClient.as_agent(), which currently forwards an invalid kwarg into Agent.__init__(). This keeps the existing TypeError behavior for callers but changes the error source to the public API boundary, which we do not consider a breaking change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7f1bc44 to
1d81979
Compare
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.
Motivation & Context
This PR applies the smallest possible fix for #6313 by removing the unsupported
function_invocation_configurationkeyword fromBaseChatClient.as_agent().The current implementation forwards that kwarg into
Agent.__init__(), which produces an internalTypeError. This change removes that unsupported path at the public API boundary instead of adding new behavior. The result is the sameTypeErrorclass for callers, but the error now comes directly fromBaseChatClient.as_agent(). We do not consider that a breaking change because the public error type is unchanged and the change only narrows the failure to the correct API surface.This PR is intentionally different from the existing open PR #6322: that PR adds deeper configuration support, while this one keeps the fix minimal and removes the unsupported path.
Description & Review Guide
function_invocation_configurationparameter fromBaseChatClient.as_agent().as_agent()with the expectedTypeError.Agent.__init__()failure.Related Issue
Fixes #6313
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.