Skip to content

.NET: Pass through external input request and handle response conversion for workflow as agent scenario#4361

Merged
peibekwe merged 12 commits intomainfrom
peibekwe/workflow-asagent-fix
Mar 25, 2026
Merged

.NET: Pass through external input request and handle response conversion for workflow as agent scenario#4361
peibekwe merged 12 commits intomainfrom
peibekwe/workflow-asagent-fix

Conversation

@peibekwe
Copy link
Copy Markdown
Contributor

Description

This PR handles external input request for non-Function call contents the right way and also fixes issue with external input response conversion from checkpoints.

Fixes #3029

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@peibekwe peibekwe self-assigned this Feb 27, 2026
@markwallace-microsoft markwallace-microsoft added .NET workflows Related to Workflows in agent-framework labels Feb 27, 2026
@github-actions github-actions bot changed the title Pass through external input request and handle response conversion for workflow as agent scenario .NET: Pass through external input request and handle response conversion for workflow as agent scenario Feb 27, 2026
@peibekwe peibekwe requested review from alliscode and lokitoth March 2, 2026 20:47
@peibekwe peibekwe marked this pull request as ready for review March 2, 2026 21:24
Copilot AI review requested due to automatic review settings March 2, 2026 21:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 improves the “workflow as agent” experience in the .NET workflows layer by preserving the original external-request content types (instead of always converting to FunctionCallContent) and enabling inbound external responses to be correctly converted back into ExternalResponse during workflow resume from checkpoints.

Changes:

  • Preserve original FunctionCallContent / UserInputRequestContent when emitting RequestInfoEvent updates to callers.
  • Track pending external requests in WorkflowSession.StateBag and convert inbound FunctionResultContent / UserInputResponseContent into ExternalResponse when resuming a run.
  • Add unit tests covering preservation of request content types and basic request/response roundtrip acceptance.

Reviewed changes

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

File Description
dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowSession.cs Tracks pending requests and converts inbound response contents into ExternalResponse on resume; preserves original request content type in streamed updates.
dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/WorkflowHostSmokeTests.cs Adds tests to validate content-type preservation and roundtrip response processing behavior.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

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

@peibekwe peibekwe added this pull request to the merge queue Mar 25, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 25, 2026
@peibekwe peibekwe added this pull request to the merge queue Mar 25, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 25, 2026
@peibekwe peibekwe added this pull request to the merge queue Mar 25, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 25, 2026
@peibekwe peibekwe added this pull request to the merge queue Mar 25, 2026
Merged via the queue into main with commit 23921c0 Mar 25, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET workflows Related to Workflows in agent-framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET Workflows - Workflow as Agent how to respond to external input requests

7 participants