Skip to content

Port .NET skill and workflow fixes - #126

Merged
Quim Muntal (qmuntal) merged 4 commits into
mainfrom
dev/qmuntal/fixbugsport
May 6, 2026
Merged

Port .NET skill and workflow fixes#126
Quim Muntal (qmuntal) merged 4 commits into
mainfrom
dev/qmuntal/fixbugsport

Conversation

@qmuntal

Copy link
Copy Markdown
Member

Summary

Validation

  • go test ./agent/skills/fsskills
  • go test ./agent/skills
  • go test ./agent/hosting/workflowhosting -run 'TestHostedAgent_(FiltersNonPortableContentFromForwardedResponseMessages|StripsRawRepresentationFromForwardedResponseMessages|PreservesForwardableContentInMixedForwardedResponseMessages|DropsResponseMessagesWithOnlyNonPortableContent)$' -count=1 -timeout=30s -v
  • go test ./agent/hosting/workflowhosting -count=1 -timeout=60s

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

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 fsskills frontmatter 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

Comment thread agent/skills/fsskills/source.go Outdated
@qmuntal
Quim Muntal (qmuntal) merged commit 65f1bb5 into main May 6, 2026
7 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the dev/qmuntal/fixbugsport branch May 6, 2026 08:05
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Cross-repo parity review

Reviewer: API Consistency Agent | Upstream ref: microsoft/agent-framework @ f25e81701


✅ Message forwarding filter (agent/hosting/workflowhosting/workflow.go)

The Go filterForwardableMessages / filterForwardableContents implementation is semantically aligned with the upstream .NET AIAgentHostExecutor.FilterForwardableMessages in dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/AIAgentHostExecutor.cs:

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 ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants