Repository navigation
.NET: Apply toolbox tool approval configuration - #9662
Roger Barreto (rogerbarreto) wants to merge 1 commit into
Conversation
Apply discovered tool configuration through the existing approval pipeline while retaining OAuth consent handling and per-call state. Keep unsupported explicit configurations on the approval path.
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues remain in metadata handling, wrapper composition, or regression coverage; tests were not independently executed.
No open issues 🎉
What changed in this PR
This PR connects Foundry Toolbox approval metadata to the framework’s existing per-call approval workflow while preserving OAuth consent handling.
Changes:
- Wraps discovered tools with
ApprovalRequiredAIFunctionwhen required, prioritizing existing approval services over metadata. - Requires approval and logs a warning for explicit unsupported or malformed configurations.
- Adds 27 regression cases covering metadata variants, approval decisions, streaming, discovery paths, and consent propagation.
| File | Description |
|---|---|
dotnet/tests/Microsoft.Agents.AI.Foundry.Hosting.UnitTests/FoundryToolboxApprovalTests.cs |
Adds approval lifecycle, metadata, discovery, and consent regression tests. |
dotnet/src/Microsoft.Agents.AI.Foundry.Hosting/FoundryToolboxService.cs |
Applies and documents approval policies during centralized tool discovery. |
Review effort: Balanced
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): b086ea734e3b
Model: gpt-5.6-sol
Overview
The change centralizes toolbox approval-policy interpretation in the common open path, so startup, lazy, deferred, and consent-retry discovery all receive the same wrapper composition. Unsupported explicit metadata fails closed, existing approval markers take precedence, and the regression suite covers policy variants, repeated decisions, streaming, argument binding, and OAuth consent propagation. No PR-introduced Critical, High, or Medium defect remained after reconciliation.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Motivation & Context
Keep discovered Foundry Toolbox functions consistent with their advertised tool-approval configuration and the framework's existing approval workflow.
Description & Review Guide
ApprovalRequiredAIFunctionwrapper when Toolbox metadata requires approval. Recognize an existing approval service before consulting metadata. Explicit unsupported configuration requires approval and emits a warning.neverpolicy retain their normal behavior, and OAuth consent handling remains intact.Local checks used .NET SDK 10.0.402 and Debug builds. Commands below run from
dotnet/.dotnet build tests\Microsoft.Agents.AI.Foundry.Hosting.UnitTests -c Debug --no-restore --tl:off --warnaserrordotnet test --project tests\Microsoft.Agents.AI.Foundry.Hosting.UnitTests -f net8.0 -c Debug --no-builddotnet test --project tests\Microsoft.Agents.AI.Foundry.Hosting.UnitTests -f net9.0 -c Debug --no-builddotnet build tests/Microsoft.Agents.AI.Foundry.Hosting.UnitTests -f net10.0 -c Debug --tl:off --warnaserrordotnet test --project tests/Microsoft.Agents.AI.Foundry.Hosting.UnitTests -f net10.0 -c Debug --no-builddotnet format src/Microsoft.Agents.AI.Foundry.Hosting --verify-no-changes --verbosity diagnosticmcr.microsoft.com/dotnet/sdk:10.0.dotnet format tests/Microsoft.Agents.AI.Foundry.Hosting.UnitTests --verify-no-changes --verbosity diagnosticmcr.microsoft.com/dotnet/sdk:10.0.dotnet build tests\Foundry.Hosting.IntegrationTests -f net10.0 -c Debug --no-restore --tl:off --warnaserrorThe affected hosting module has 90.05% line coverage. These are scoped local results, not a claim that the full solution or published-head CI has passed.
Related Issue
N/A - maintainer-directed consistency correction; no public tracking issue. No competing open PR changes Toolbox approval configuration handling.
AI Assistance
AI assistance details: implementation, regression tests, XML documentation, validation, and this PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after a language prefix) — a workflow keeps the label and title prefix in sync automatically.