Skip to content

[dotnet-code] Split workflow output filter internals - #828

Open
Michelle Clayton (michelle-clayton-work) wants to merge 1 commit into
mainfrom
dotnet-code-output-filter-20260811223628-8e10f9748ded50f4
Open

[dotnet-code] Split workflow output filter internals#828
Michelle Clayton (michelle-clayton-work) wants to merge 1 commit into
mainfrom
dotnet-code-output-filter-20260811223628-8e10f9748ded50f4

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Summary

Split the in-process workflow output filter so output eligibility is checked separately from tag lookup. This keeps the Go runner behavior unchanged while making the internal shape closer to the .NET OutputFilter, where CanOutput and TryGetTags are distinct operations.

.NET Reference

  • dotnet/src/Microsoft.Agents.AI.Workflows/Execution/OutputFilter.cs - separates output eligibility (CanOutput) from output tag retrieval (TryGetTags).

Public API and Behavior

No public Go API changed. No intentional behavior change was made.

Tests

  • go test ./workflow/inproc

Notes

Random sample candidates inspected included workflow output filtering, loop context, MCP skill resources, and tool approval rules. Rejected LoopContext.cs because the comparable Go loop context is public API shape rather than a safe internal cleanup. Rejected AgentMcpSkillResource.cs because the current Go MCP tool integration does not have a directly comparable skill-resource abstraction to refactor without adding features. Rejected ToolApprovalRule.cs because Go already preserves the .NET null-vs-empty argument rule distinction with existing tests, so further edits would add churn.

Generated by .NET-to-Go Code Portability Refactoring Agent · gpt55 · 69.5 AIC · ⌖ 11.9 AIC · ⊞ 23.2K ·

Closes #825

Split workflow output eligibility from tag lookup so the in-process runner mirrors the .NET OutputFilter shape more closely while preserving existing filtering behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 refactors the in-process workflow output filter internals to better mirror the .NET OutputFilter shape by splitting “output eligibility” from “tag lookup”, while aiming to preserve existing runner behavior.

Changes:

  • Added outputFilter.canOutput to check whether an executor is eligible to emit output.
  • Updated runnerContext.yieldOutput to call canOutput before retrieving output tags.
  • Kept tag cloning behavior in tryGetTags unchanged.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
workflow/inproc/context.go Uses the new eligibility check before fetching tags and emitting OutputEvent.
workflow/inproc/outputfilter.go Introduces canOutput to separate eligibility checks from tag retrieval.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +619 to +622
if !proc.outputFilter.canOutput(executorID, output) {
return nil
}
tags, _ := proc.outputFilter.tryGetTags(executorID)
return &outputFilter{tagsByExecutor: wf.OutputExecutors()}
}

func (f *outputFilter) canOutput(executorID string, _ any) bool {
@github-actions

Copy link
Copy Markdown
Contributor

Parity Review: ✅ Approved

This PR refactors unexported internals in workflow/inproc/ only — no exported Go API surface changed.

The change aligns the internal Go output filter shape with the .NET OutputFilter.cs separation of CanOutput and TryGetTags, which is exactly the goal described in the PR. The observable behavior of the Go runner is unchanged: the same executorID eligibility check and tag lookup happen in the same order; they are just now delegated to separate methods.

Scope: workflow/inproc/outputfilter.go and workflow/inproc/context.go — both files contain only unexported types and functions.

Cross-repo parity: The structural alignment with .NET OutputFilter.CanOutput / TryGetTags is semantically consistent. No Python equivalent of this internal filter exists to check.

No public API label needed: No exported identifiers were added, removed, or changed.

Generated by Go API Consistency Review Agent for #828 · sonnet46 · 19 AIC · ⌖ 5.56 AIC · ⊞ 5.7K ·

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity-approved Go API consistency review found no parity issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-code] Split workflow output filter internals

2 participants