[dotnet-code] Consolidate workflow idle status helper - #928
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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 : Idleblocks with a shared helper call. - Added
idleOrPendingRequestsStatus(stepRunner SuperStepRunner) RunStatusto centralize the mapping logic.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Go API Consistency ReviewScope: internal-only This PR extracts a repeated The refactor mirrors the compact ternary expression shape already used in No parity issues found. No
|
Summary
Consolidates the internal workflow execution status decision that maps unserviced requests to
PendingRequestsand otherwise toIdle. This mirrors the compact .NETHasUnservicedRequests ? PendingRequests : Idleshape 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/executionNotes
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.Closes #906