Port .NET skill and workflow fixes - #126
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ports upstream fixes into the Go agent framework to improve (1) file-skill frontmatter parsing for YAML block scalars and (2) hosted-agent message forwarding through workflows by filtering out non-portable/provider-artifact content and stripping message-level raw provider representations.
Changes:
- Extend
fsskillsfrontmatter parsing to support YAML block scalar values (|,>) including basic chomping indicators. - Filter hosted-agent response messages before forwarding through workflows, keeping only forwardable content types and removing
Message.RawRepresentation. - Add targeted unit tests covering block-scalar parsing and workflow-forwarding filtering behavior.
Show a summary per file
| File | Description |
|---|---|
| agent/skills/fsskills/source.go | Adds block-scalar parsing support for YAML frontmatter values. |
| agent/skills/fsskills/source_test.go | Adds tests validating multiline block scalar parsing and chomping indicators. |
| agent/hosting/workflowhosting/workflow.go | Filters forwarded response messages to avoid non-portable/provider-artifact content and strips message-level raw representations. |
| agent/hosting/workflowhosting/workflow_test.go | Adds tests ensuring forwarded messages are filtered/stripped as intended. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 1
Cross-repo parity reviewReviewer: API Consistency Agent | Upstream ref: ✅ Message forwarding filter (
|
| Aspect | .NET | Go |
|---|---|---|
| Allowlisted content types | TextContent, DataContent, UriContent, FunctionCallContent, FunctionResultContent, ToolApprovalRequest/ResponseContent, HostedFileContent, ErrorContent |
Same nine types (mapped to Go equivalents) |
Message-level RawRepresentation |
Stripped (new object constructed without it) | Stripped (Clone() then nil) |
Content-level RawRepresentation |
Preserved (content items are shared refs) | Preserved (same, confirmed by TestHostedAgent_StripsRawRepresentation...) |
| Messages with zero forwardable content | Dropped entirely | Dropped entirely |
No parity concern here.
⚠️ Folded YAML scalar paragraph-break handling (agent/skills/fsskills/source.go)
The upstream .NET ParseYamlScalarValue in AgentFileSkillsSource.cs handles the folded style (>) as:
string.Join(" ", normalizedLines.Where(line => line.Length > 0))Blank lines are silently discarded — the output is a single space-joined string with no paragraph breaks.
The Go foldYamlLines does something different: blank lines between non-blank lines are converted to \n characters in the output, so this input:
description: >
First paragraph line one
line two
Second paragraph.produces "First paragraph line one line two\nSecond paragraph." in Go, but would produce "First paragraph line one line two Second paragraph." in .NET.
TestFileSource_FoldedScalarDescription_PreservesParagraphBreaks exercises and documents this divergence.
Note: The Go behaviour is arguably more correct per the YAML 1.2 specification (blank lines in folded blocks should become literal newlines). However, this is a real cross-SDK behavioural difference: a skill whose description uses multi-paragraph folded syntax will produce different values in Go vs. .NET, which could affect how the description appears in system prompts.
Suggestion: Please check whether upstream microsoft/agent-framework#5610 intended to add paragraph-break support for the folded style, or whether the .NET implementation intentionally simplified it. If the .NET behaviour is intentional (e.g., to keep descriptions as a single sentence regardless of author formatting), the Go implementation should align. If the Go behaviour is considered the correct fix, upstream .NET (AgentFileSkillsSource.cs) should receive the same fix for consistency.
Generated by Go API Consistency Review Agent for issue #126 · ● 1.2M · ◷
Summary
Validation