Skip to content

[dotnet-code] Consolidate workflow idle status helper - #928

Merged
Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-code-run-status-helper-b01a50a0ecc05c62
Aug 28, 2026
Merged

[dotnet-code] Consolidate workflow idle status helper#928
Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-code-run-status-helper-b01a50a0ecc05c62

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Summary

Consolidates the internal workflow execution status decision that maps unserviced requests to PendingRequests and otherwise to Idle. This mirrors the compact .NET HasUnservicedRequests ? PendingRequests : Idle shape and reduces duplicated status-transition logic for future ports.

.NET Reference

  • dotnet/src/Microsoft.Agents.AI.Workflows/Execution/LockstepRunEventStream.cs - uses a single pending-request status expression in the lockstep run stream.

Public API and Behavior

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

Tests

  • go test ./workflow/internal/execution

Notes

Rejected candidates inspected from the random sample:

  • dotnet/src/Microsoft.Agents.AI.Abstractions/AgentResponse.cs / agent/response.go - Go response text and update aggregation were already closely aligned; further changes risked churn.
  • dotnet/src/Microsoft.Agents.AI.Workflows/RequestInfoEvent.cs / workflow/event.go - event wrapper shape was already minimal and equivalent.
  • dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/ChatCompletions/Models/MessageContentPart.cs / message/content.go - provider/content model differences did not reveal a safe small internal cleanup.

Open [dotnet-code] PRs checked before editing; none appeared to cover the workflow idle-status candidate.

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

Closes #906

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 27, 2026 17:45
@github-actions github-actions Bot added area:workflow Changes files in the workflow area size:medium At most 100 changed lines across at most 5 files labels Aug 27, 2026

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 consolidates the internal “idle vs pending-requests” run-status decision into a single helper, reducing duplicated status-transition logic in the workflow event stream implementations while preserving existing behavior.

Changes:

  • Replaced repeated HasUnservicedRequests() ? PendingRequests : Idle blocks with a shared helper call.
  • Added idleOrPendingRequestsStatus(stepRunner SuperStepRunner) RunStatus to centralize the mapping logic.

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

@github-actions

Copy link
Copy Markdown
Contributor

Go API Consistency Review

Scope: internal-only
Changed Go contract: None — no exported APIs or user-visible behaviors changed
Upstream evidence reviewed: dotnet/src/Microsoft.Agents.AI.Workflows/Execution/LockstepRunEventStream.cs (cited in PR description as the reference for the HasUnservicedRequests ? PendingRequests : Idle pattern)
Result: out of scope for parity review


This PR extracts a repeated if/else status decision into the unexported helper idleOrPendingRequestsStatus inside workflow/internal/execution/. The logic, semantics, and observable behavior are unchanged — only the duplication is reduced. No exported Go symbols were added, removed, or altered.

The refactor mirrors the compact ternary expression shape already used in LockstepRunEventStream.cs, so the structural alignment with .NET is improved, not diverged.

No parity issues found. No public-api-change label is warranted.

Generated by Go API Consistency Review Agent for #928 · sonnet46 · 15.3 AIC · ⌖ 5.82 AIC · ⊞ 6.4K ·

@github-actions github-actions Bot added parity-approved Go API consistency review found no parity issues kind:code Changes production behavior or code pending-auto-risk Automatic risk classification is in progress risk:low Limited blast radius and straightforward rollback and removed pending-auto-risk Automatic risk classification is in progress labels Aug 27, 2026
@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit 41bda7a Aug 28, 2026
37 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the dotnet-code-run-status-helper-b01a50a0ecc05c62 branch August 28, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workflow Changes files in the workflow area kind:code Changes production behavior or code parity-approved Go API consistency review found no parity issues risk:low Limited blast radius and straightforward rollback size:medium At most 100 changed lines across at most 5 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-code] Consolidate workflow idle status helper

3 participants