.NET code patching template + infrastructure#14467
Open
m-redding wants to merge 12 commits intoAzure:mainfrom
Open
.NET code patching template + infrastructure#14467m-redding wants to merge 12 commits intoAzure:mainfrom
m-redding wants to merge 12 commits intoAzure:mainfrom
Conversation
benbp
reviewed
Mar 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds .NET support to azsdk-cli’s error-driven customization repair pipeline, aligning with the existing Java/Python patch-agent flow while accounting for .NET partial-class conventions (e.g., Generated/ vs customization files and class/file rename coupling).
Changes:
- Introduces
DotnetErrorDrivenPatchTemplateto guide an agent to apply safe, surgical fixes to C# customization files based on build errors. - Wires
DotnetLanguageService.ApplyPatchesAsyncto run the patch agent withReadFile,GrepSearch,CodePatchTool, and a newRenameFiletool (with generated-code exclusion and early exit when no.csfiles exist). - Adds
FileTools.CreateRenameFileTool(path-traversal protected) plus tests; also adjusts logging to always suppress Copilot SDK noise even in debug mode.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/Languages/DotnetLanguageService.cs | Adds patch-agent execution for .NET customization repair, excludes Generated/, includes RenameFile tool. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli/Prompts/Templates/DotnetErrorDrivenPatchTemplate.cs | New .NET-specific error-driven patch prompt grounded in partial-class patterns and safe patching rules. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli/Program.cs | Always suppresses GitHub.Copilot.SDK logs below warning level, even in debug mode. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli/CopilotAgents/Tools/FileTools.cs | Adds RenameFile AIFunction with safe path resolution and basic rename validations. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Tools/Package/SdkBuildToolTests.cs | Updates DotnetLanguageService construction for new ICopilotAgentRunner dependency. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Tools/Package/PackToolTests.cs | Updates DotnetLanguageService construction for new ICopilotAgentRunner dependency. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Tools/Generators/SampleGeneratorToolTests.cs | Updates DotnetLanguageService construction for new ICopilotAgentRunner dependency. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Services/Languages/LanguageServicePackageInfoTests.cs | Updates DotnetLanguageService construction for new ICopilotAgentRunner dependency. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Services/Languages/DotnetLanguageServicePatchTests.cs | New tests validating .NET patch agent invocation behavior, exclusions, and cancellation propagation. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Services/Languages/DotNetLanguageSpecificChecksTests.cs | Updates DotnetLanguageService construction for new ICopilotAgentRunner dependency. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Prompts/Templates/DotnetErrorDrivenPatchTemplateTests.cs | New tests validating prompt content and expected guidance/tool references. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Helpers/DotNetPackageInfoHelperTests.cs | Updates DotnetLanguageService construction for new ICopilotAgentRunner dependency. |
| tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/CopilotAgents/Tools/FileToolsTests.cs | Adds RenameFile tool tests (success, traversal protection, edge cases, callback, directory creation). |
samvaity
approved these changes
Mar 18, 2026
Removed suppression of Copilot SDK logging in debug mode.
samvaity
approved these changes
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #14274
Adds the .NET equivalent of the Java/Python error-driven patch template, enabling the customization repair pipeline to fix C# build errors in
partial-class customization files.
What's included
customizations)
.NET-specific additions over Java/Python
Tests