.NET: Add description attribute to resource and script elements in skill body#6759
Merged
SergeyMenshykh merged 2 commits intoJun 26, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores the optional description="..." attribute on <resource> and <script> entries emitted into skill bodies (under <available_resources> / <available_scripts>), after it was removed during prior XML restructuring. This helps retain human-authored metadata while keeping the output safe via XML escaping.
Changes:
- Emit
description="..."on<resource>elements whenAgentSkillResource.Descriptionis non-null/non-empty (XML-escaped). - Emit
description="..."on<script>elements whenAgentSkillScript.Descriptionis non-null/non-empty (XML-escaped), for both schema and non-schema script cases. - Update unit tests to validate description rendering/omission and resource description escaping.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI/Skills/Programmatic/AgentInlineSkillContentBuilder.cs | Adds optional description attributes to emitted resource/script XML entries, with escaping. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/AgentInlineSkillContentBuilderTests.cs | Updates/adds assertions for description emission and omission; adds resource description escaping coverage. |
| dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowHostingExtensions.cs | Fixes a duplicated word in an XML doc comment. |
d396aec to
6de4fa9
Compare
6de4fa9 to
b121268
Compare
westey-m
approved these changes
Jun 26, 2026
peibekwe
reviewed
Jun 26, 2026
peibekwe
approved these changes
Jun 26, 2026
…ill body Include the optional description attribute on <resource> and <script> elements within <available_resources> and <available_scripts> blocks, aligning .NET with the Python implementation. The description is emitted only when non-null/non-empty and is XML-escaped. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b121268 to
af796a8
Compare
peibekwe
approved these changes
Jun 26, 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.
Summary
Re-adds the optional
descriptionattribute to<resource>and<script>elements within the<available_resources>and<available_scripts>XML blocks injected into skill bodies. Descriptions were removed incidentally in #6343 during a broader XML restructuring.Changes
AgentInlineSkillContentBuilder.cs— Emitdescription="..."attribute on<resource>and<script>elements when the description is non-null and non-empty. Values are XML-escaped.AgentInlineSkillContentBuilderTests.cs— Added tests for description rendering, escaping, and empty-string omission.Closes: #6760