Skip to content

.Net: Preserve agent execution settings in handoff orchestration#13946

Open
tejakusireddy wants to merge 1 commit intomicrosoft:mainfrom
tejakusireddy:fix-handoff-execution-settings
Open

.Net: Preserve agent execution settings in handoff orchestration#13946
tejakusireddy wants to merge 1 commit intomicrosoft:mainfrom
tejakusireddy:fix-handoff-execution-settings

Conversation

@tejakusireddy
Copy link
Copy Markdown

Motivation and Context

Fixes #13935.

Handoff orchestration created invocation options with a new base PromptExecutionSettings, which dropped agent-level provider-specific settings such as OpenAI reasoning_effort.

Description

Preserves the agent's existing execution settings when creating handoff invocation options by cloning them before applying handoff function choice behavior.

Also preserves existing agent argument parameters and adds a regression test that verifies reasoning_effort is included in the outgoing request body.

Contribution Checklist

Copilot AI review requested due to automatic review settings May 3, 2026 02:08
@tejakusireddy tejakusireddy requested a review from a team as a code owner May 3, 2026 02:08
@moonbox3 moonbox3 added the .NET Issue or Pull requests regarding .NET code label May 3, 2026
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 fixes a .NET handoff orchestration bug where invocation options were created with a fresh base PromptExecutionSettings, causing agent-level provider-specific settings (e.g., OpenAI reasoning_effort) to be lost during orchestration.

Changes:

  • Update handoff invocation option creation to clone the agent’s existing PromptExecutionSettings per serviceId and then apply the required handoff FunctionChoiceBehavior.
  • Preserve existing agent argument parameters when constructing KernelArguments for the handoff invocation.
  • Add a regression unit test verifying reasoning_effort is present in the outgoing OpenAI request body during handoff orchestration.

Reviewed changes

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

File Description
dotnet/src/Agents/Orchestration/Handoff/HandoffActor.cs Clones agent execution settings (preserving provider-specific fields) and applies handoff auto function choice behavior without dropping settings.
dotnet/src/Agents/UnitTests/Orchestration/HandoffOrchestrationTests.cs Adds regression coverage to ensure OpenAI reasoning_effort survives orchestration and is serialized into the request body.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Automated Code Review

Reviewers: 4 | Confidence: 89% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Design Approach


Automated review by tejakusireddy's agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.Net: Bug: Semantic Kernel Orchestration: ReasoningEffort setting becomes lost when invoking

3 participants