.NET: Pass ChatClientAgent tools per run only rather than setting on FICC - #8531
westey (westey-m) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 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
There was a problem hiding this comment.
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
Motivation & Context
Setting tools both on FICC and passing them on ChatOptions duplicates the tools.
Description & Review Guide
Related Issue
Fixes #
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.