Skip to content

Python: Remove unsupported as_agent function_invocation_configuration#6520

Open
eavanvalkenburg wants to merge 2 commits into
microsoft:mainfrom
eavanvalkenburg:fix/6313-remove-as-agent-function-invocation-config
Open

Python: Remove unsupported as_agent function_invocation_configuration#6520
eavanvalkenburg wants to merge 2 commits into
microsoft:mainfrom
eavanvalkenburg:fix/6313-remove-as-agent-function-invocation-config

Conversation

@eavanvalkenburg

@eavanvalkenburg eavanvalkenburg commented Jun 15, 2026

Copy link
Copy Markdown
Member

Motivation & Context

This PR applies the smallest possible fix for #6313 by removing the unsupported function_invocation_configuration keyword from BaseChatClient.as_agent().

The current implementation forwards that kwarg into Agent.__init__(), which produces an internal TypeError. This change removes that unsupported path at the public API boundary instead of adding new behavior. The result is the same TypeError class for callers, but the error now comes directly from BaseChatClient.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

  • What are the major changes?
    • Remove the unsupported function_invocation_configuration parameter from BaseChatClient.as_agent().
    • Add a regression test that asserts the public API now fails at as_agent() with the expected TypeError.
  • What is the impact of these changes?
    • Callers using this unsupported kwarg now hit the correct public API error path immediately, without an internal Agent.__init__() failure.
    • No new behavior is introduced; this is a minimal removal fix for the unsupported path.
  • What do you want reviewers to focus on?
    • Confirm that this stays intentionally minimal and that the regression test captures the public API behavior we want.

Related Issue

Fixes #6313

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

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.

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_configuration parameter (and related forwarding) from BaseChatClient.as_agent().
  • Added a regression test asserting as_agent(function_invocation_configuration=...) raises TypeError with 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.

@eavanvalkenburg eavanvalkenburg marked this pull request as ready for review June 15, 2026 13:18
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   _clients.py140695%322, 373, 536–539
TOTAL39950450788% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
7977 34 💤 0 ❌ 0 🔥 2m 9s ⏱️

@github-actions github-actions Bot 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.

Automated Code Review

Reviewers: 5 | Confidence: 94% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by eavanvalkenburg's agents

@moonbox3 moonbox3 added this pull request to the merge queue Jun 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 16, 2026
@eavanvalkenburg eavanvalkenburg force-pushed the fix/6313-remove-as-agent-function-invocation-config branch from 96aa46c to e66a5e6 Compare June 16, 2026 08:28
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Jun 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 16, 2026
@westey-m westey-m enabled auto-merge June 16, 2026 13:25
@westey-m westey-m added this pull request to the merge queue Jun 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 16, 2026
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Jun 16, 2026
@eavanvalkenburg eavanvalkenburg removed this pull request from the merge queue due to a manual request Jun 16, 2026
eavanvalkenburg and others added 2 commits June 16, 2026 17:14
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>
@eavanvalkenburg eavanvalkenburg force-pushed the fix/6313-remove-as-agent-function-invocation-config branch from 7f1bc44 to 1d81979 Compare June 16, 2026 15:14
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Jun 16, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: function_invocation_configuration from BaseChatClient.as_agent doesn't work

5 participants