Skip to content

.NET: Honor cancellation for Foundry-hosted workflow responses - #7842

Merged
Roger Barreto (rogerbarreto) merged 3 commits into
mainfrom
copilot/fix-cancellation-signal-handling
Aug 25, 2026
Merged

.NET: Honor cancellation for Foundry-hosted workflow responses#7842
Roger Barreto (rogerbarreto) merged 3 commits into
mainfrom
copilot/fix-cancellation-signal-handling

Conversation

Copilot AI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

Workflow cancellation can end the underlying .NET workflow stream normally, causing the hosting adapter to emit response.completed instead of allowing AgentServer to finalize the response as cancelled.

Description & Review Guide

  • What are the major changes?
    • Recheck the linked cancellation token before accepting a successful terminal event.
    • Add in-flight cancellation coverage for regular and workflow-backed agents.
  • What is the impact of these changes?
    • Explicit cancellation no longer produces a false successful completion.
    • Existing steering, consent, and shutdown handling remains unchanged.
  • What do you want reviewers to focus on?
    • Cancellation classification around workflow stream exhaustion and terminal-event emission.

Related Issue

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings August 24, 2026 12:16

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.

Copilot wasn't able to review any files in this pull request.


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

Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cancellation signal handling in WorkflowAgent Honor cancellation for Foundry-hosted workflow responses Aug 24, 2026
@rogerbarreto Roger Barreto (rogerbarreto) changed the title Honor cancellation for Foundry-hosted workflow responses .NET: Honor cancellation for Foundry-hosted workflow responses Aug 24, 2026
@agent-framework-automation agent-framework-automation Bot added the .NET Usage: [Issues, PRs], Target: .Net label Aug 24, 2026
@rogerbarreto
Roger Barreto (rogerbarreto) marked this pull request as ready for review August 24, 2026 20:07
@rogerbarreto
Roger Barreto (rogerbarreto) added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit ce65413 Aug 25, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Foundry hosting: WorkflowAgent path drops cancellation_signal

5 participants