.NET: Fix YAML block scalar parsing for file skills#5610
Merged
SergeyMenshykh merged 2 commits intomicrosoft:mainfrom May 5, 2026
Merged
.NET: Fix YAML block scalar parsing for file skills#5610SergeyMenshykh merged 2 commits intomicrosoft:mainfrom
SergeyMenshykh merged 2 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes .NET SKILL.md frontmatter parsing so YAML block scalar values (e.g., description: | / description: >) are parsed as multiline content instead of just the scalar indicator, addressing issue #5586.
Changes:
- Updates the .NET file skill loader to detect block scalar indicators and read indented continuation lines.
- Normalizes indentation and applies basic literal (
|) vs folded (>) joining behavior. - Adds unit tests covering literal, folded, and chomping-indicator variants.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI/Skills/File/AgentFileSkillsSource.cs | Adds block-scalar-aware parsing when extracting frontmatter scalar values. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillLoaderTests.cs | Adds regression tests for parsing multiline description values from YAML block scalars. |
westey-m
approved these changes
May 5, 2026
peibekwe
approved these changes
May 5, 2026
This was referenced May 8, 2026
This was referenced May 8, 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.
Motivation and Context
Fixes the .NET file skill loader portion of #5586.
SKILL.mdfrontmatter currently parses YAML block scalar values likedescription: |ordescription: >as only the scalar indicator (|/>) instead of the multiline content.Description
This PR updates the .NET file skill loader to parse YAML block scalar values in frontmatter.
Changes:
|,|-,|+>,>-,>+FileAgentSkillLoaderTestsContribution Checklist
Validation:
dotnet build ./dotnet/tests/Microsoft.Agents.AI.UnitTests/Microsoft.Agents.AI.UnitTests.csprojFileAgentSkillLoaderTests: 79/79 passedMicrosoft.Agents.AI.UnitTestsnet10.0 assembly: 1459/1459 passed