Skip to content

.NET: Improving DotNet samples#6869

Merged
alliscode merged 3 commits into
microsoft:mainfrom
alliscode:dotnet-sample-fix-v2
Jul 2, 2026
Merged

.NET: Improving DotNet samples#6869
alliscode merged 3 commits into
microsoft:mainfrom
alliscode:dotnet-sample-fix-v2

Conversation

@alliscode

Copy link
Copy Markdown
Member

Fixing several dotnet samples.

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.

alliscode and others added 3 commits June 29, 2026 17:39
…ce generator

Replace the direct logger.LogWarning() call (which eagerly evaluates
string.Join()) with a [LoggerMessage]-generated extension method in
GitHubCopilotAgentLogMessages.cs.

Fixes build error:
  GitHubCopilotAgent.cs(580,13): error CA1873: Evaluation of this argument
  may be expensive and unnecessary if logging is disabled

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 20:01
@giles17 giles17 added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net labels Jul 1, 2026
@github-actions github-actions Bot changed the title Improving DotNet samples .NET: Improving DotNet samples Jul 1, 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.

Pull request overview

Updates several .NET samples to improve out-of-the-box execution, especially around Agent Skills tool approvals and the Foundry OpenAPI tools example.

Changes:

  • Added tool-approval middleware with auto-approval rules to the Agent Skills samples so skill tool calls can run without interactive approval prompts.
  • Updated the Foundry OpenAPI tools sample to use the Frankfurter exchange-rate API (instead of the countries-by-currency scenario) and refreshed the sample prompt/docs.
  • Updated sample verification metadata for the Agent Skills samples and adjusted the expected output description for the OpenAPI tools sample.
Show a summary per file
File Description
dotnet/src/Microsoft.Agents.AI.GitHub.Copilot/GitHubCopilotAgent.cs Removes an extraneous blank line in session config conversion logic.
dotnet/samples/02-agents/AgentSkills/Agent_Step06_McpBasedSkills/Program.cs Adds tool-approval middleware with auto-approval for skill tools in the MCP-based skills sample.
dotnet/samples/02-agents/AgentSkills/Agent_Step01_FileBasedSkills/Program.cs Adds tool-approval middleware with auto-approval for skill tools in the file-based skills sample.
dotnet/samples/02-agents/AgentProviders/foundry/Agent_Step17_OpenAPITools/README.md Updates the README description to match the new Frankfurter exchange-rate scenario.
dotnet/samples/02-agents/AgentProviders/foundry/Agent_Step17_OpenAPITools/Program.cs Switches the OpenAPI tool definition and prompt to the Frankfurter exchange-rate API.
dotnet/eng/verify-samples/AgentsSamples.cs Updates env-var gating for the skills samples and updates expected output text for the OpenAPI tools sample.

Review details

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread dotnet/eng/verify-samples/AgentsSamples.cs
@alliscode alliscode added this pull request to the merge queue Jul 2, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 2, 2026
@alliscode alliscode added this pull request to the merge queue Jul 2, 2026
Merged via the queue into microsoft:main with commit db80926 Jul 2, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants