[dotnet-code] Split workflow output filter internals - #828
Conversation
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>
There was a problem hiding this comment.
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.canOutputto check whether an executor is eligible to emit output. - Updated
runnerContext.yieldOutputto callcanOutputbefore retrieving output tags. - Kept tag cloning behavior in
tryGetTagsunchanged.
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.
| 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 { |
Parity Review: ✅ ApprovedThis PR refactors unexported internals in The change aligns the internal Go output filter shape with the .NET Scope: Cross-repo parity: The structural alignment with .NET No public API label needed: No exported identifiers were added, removed, or changed.
|
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, whereCanOutputandTryGetTagsare 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/inprocNotes
Random sample candidates inspected included workflow output filtering, loop context, MCP skill resources, and tool approval rules. Rejected
LoopContext.csbecause the comparable Go loop context is public API shape rather than a safe internal cleanup. RejectedAgentMcpSkillResource.csbecause the current Go MCP tool integration does not have a directly comparable skill-resource abstraction to refactor without adding features. RejectedToolApprovalRule.csbecause Go already preserves the .NET null-vs-empty argument rule distinction with existing tests, so further edits would add churn.Closes #825