Skip to content

.NET: Pass ChatClientAgent tools per run only rather than setting on FICC - #8531

Queued
westey (westey-m) wants to merge 2 commits into
microsoft:mainfrom
westey-m:dotnet-chatclientagent-tools-advertise
Queued

westey (westey-m) wants to merge 2 commits into
microsoft:mainfrom
westey-m:dotnet-chatclientagent-tools-advertise

Conversation

@westey-m

Copy link
Copy Markdown
Contributor

Motivation & Context

Setting tools both on FICC and passing them on ChatOptions duplicates the tools.

Description & Review Guide

  • What are the major changes?
  • What is the impact of these changes?
  • What do you want reviewers to focus on?

Related Issue

Fixes #

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 balanced review requested due to automatic review settings September 18, 2026 14:44
@agent-framework-automation agent-framework-automation Bot added the .NET Usage: [Issues, PRs], Target: .Net label Sep 18, 2026
@github-actions github-actions Bot changed the title Pass ChatClientAgent tools per run only rather than setting on FICC .NET: Pass ChatClientAgent tools per run only rather than setting on FICC Sep 18, 2026

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.

🟡 Changes recommended

Four existing Anthropic tests retain assertions that will fail under the new tool-scoping behavior.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Scopes ChatClientAgent tools per agent run, preventing duplication and leakage through shared clients.

Changes:

  • Removes tool assignment to shared FunctionInvokingChatClient.AdditionalTools.
  • Adds coverage for tool isolation between agents.
File summaries
File Description
dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientExtensionsTests.cs Tests shared-client tool isolation.
dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientExtensions.cs Keeps tools in per-agent chat options.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientExtensions.cs

@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.

MAF Automated Review — Iteration 1

Result: Findings reported
Scope: full PR (1 commit(s)): eb91ee35bbd9
Model: gpt-5.6-sol-fast

Overview

The PR removes agent-specific tools from shared FunctionInvokingChatClient state and relies on the existing per-run ChatOptions.Tools merge path instead. Constructor cloning, request-level merging, streaming and non-streaming forwarding, and the new shared-client regression test support that runtime contract. However, four tests in the active Anthropic unit-test project still require tools in AdditionalTools, so the current change deterministically breaks that suite.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.

Affected areas: dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientExtensions.cs

Comment thread dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientExtensions.cs
@westey-m
westey (westey-m) added this pull request to the merge queue Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants