Python: Fix the example of multi-tier handoff workflow with specialist-to-specialist routing#2332
Merged
eavanvalkenburg merged 3 commits intomicrosoft:mainfrom Nov 21, 2025
Conversation
…rsation after trigger the last response as the comment describes
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the multi-tier handoff workflow example where the same user input was being sent twice, and updates the termination condition and expected output to accurately reflect the workflow behavior.
Key changes:
- Updated termination condition from
> 4to> 3user messages - Removed duplicate sending of initial user message by using
scripted_responses[0]instead of hardcoded string - Adjusted
response_indexto start at 1 instead of 0 to account for the initial message already being sent - Updated expected output to match the corrected workflow flow
python/samples/getting_started/workflows/orchestration/handoff_specialist_to_specialist.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
moonbox3
approved these changes
Nov 20, 2025
eavanvalkenburg
approved these changes
Nov 21, 2025
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…t-to-specialist routing (microsoft#2332) * Fix the example (1) to send only one initial message (2) to end conversation after trigger the last response as the comment describes * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * changed the hard-coded user query --------- Co-authored-by: tsuting.kao <tsu.kao@microsoft.com> Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
In the example of multi-tier handoff workflow with specialist-to-specialist routing, the same user inputs are being sent twice. This leads to redundant processing and may cause slight confusion for users. Additionally, the behavior does not align with the comment in the code.
At line 184, the comment states:
"Thank you!", # Final response to trigger termination after billing agent answersHowever, the actual workflow terminates one step earlier than described.
Description
Send the same user input once, fix the comment and the expected output, and the number of times to terminate the workflow.
Contribution Checklist