Skip to content

.NET: Fix InvokeMcpTool approval path for declarative workflows#6177

Merged
peibekwe merged 2 commits into
mainfrom
peibekwe/declarative-mcp-fix
May 29, 2026
Merged

.NET: Fix InvokeMcpTool approval path for declarative workflows#6177
peibekwe merged 2 commits into
mainfrom
peibekwe/declarative-mcp-fix

Conversation

@peibekwe
Copy link
Copy Markdown
Contributor

Motivation and Context

Fix InvokeMcpTool approval path for declarative workflows to remove passing headers.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@peibekwe peibekwe self-assigned this May 29, 2026
Copilot AI review requested due to automatic review settings May 29, 2026 17:32
@moonbox3 moonbox3 added .NET workflows Related to Workflows in agent-framework labels May 29, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 4 | Confidence: 91% | Result: All clear

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


Automated review by peibekwe's agents

@github-actions github-actions Bot changed the title Fix InvokeMcpTool approval path for declarative workflows .NET: Fix InvokeMcpTool approval path for declarative workflows May 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 fixes the declarative InvokeMcpTool approval flow so transport headers are not exposed through externally surfaced approval requests while preserving header forwarding for actual MCP transport calls.

Changes:

  • Removes transport headers from McpServerToolCallContent.AdditionalProperties in approval requests.
  • Adds tests validating approval payloads exclude secret headers.
  • Adds a test validating direct MCP invocation still forwards headers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
dotnet/src/Microsoft.Agents.AI.Workflows.Declarative/ObjectModel/InvokeMcpToolExecutor.cs Stops copying transport headers into approval request tool-call metadata.
dotnet/tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/ObjectModel/InvokeMcpToolExecutorTest.cs Adds regression coverage for header exclusion from approval content and direct invocation header forwarding.

@peibekwe peibekwe marked this pull request as ready for review May 29, 2026 18:31
@peibekwe peibekwe requested review from alliscode and lokitoth May 29, 2026 18:31
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 4 | Confidence: 93% | Result: All clear

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


Automated review by peibekwe's agents

@peibekwe peibekwe added this pull request to the merge queue May 29, 2026
Merged via the queue into main with commit 11c8d89 May 29, 2026
37 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET workflows Related to Workflows in agent-framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants