Skip to content

Python: fix sequential workflow sample output handling#5976

Merged
moonbox3 merged 1 commit into
microsoft:mainfrom
he-yufeng:fix/sequential-agents-sample-response-update
May 22, 2026
Merged

Python: fix sequential workflow sample output handling#5976
moonbox3 merged 1 commit into
microsoft:mainfrom
he-yufeng:fix/sequential-agents-sample-response-update

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • update the sequential workflow sample to avoid treating streaming output chunks as a final conversation list
  • use output_from=all so both participant responses are visible
  • print the initial user prompt plus each agent response message from the non-streaming run result

Fixes #5975

To verify

  • uv run python -m py_compile samples/03-workflows/orchestrations/sequential_agents.py
  • uv run ruff check samples/03-workflows/orchestrations/sequential_agents.py
  • uv run pyright samples/03-workflows/orchestrations/sequential_agents.py
  • uv run pytest packages/orchestrations/tests/test_sequential.py packages/orchestrations/tests/test_orchestration_intermediate_vs_terminal.py -q -p no:cacheprovider

Copilot AI review requested due to automatic review settings May 20, 2026 16:39
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

Note

Copilot was unable to run its full agentic suite in this review.

Updates the Python sequential workflow sample to correctly handle sequential workflow outputs by using non-streaming results and printing both agents’ visible responses.

Changes:

  • Switches the sample from streaming collection to a single non-streaming run() result.
  • Configures the workflow to emit outputs from all participants (output_from="all").
  • Builds and prints a combined conversation containing the initial user prompt plus each agent’s response messages.

Comment thread python/samples/03-workflows/orchestrations/sequential_agents.py
Comment thread python/samples/03-workflows/orchestrations/sequential_agents.py
Copy link
Copy Markdown
Contributor

@moonbox3 moonbox3 left a comment

Choose a reason for hiding this comment

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

Thanks for the fixes.

@moonbox3 moonbox3 enabled auto-merge May 22, 2026 04:04
@moonbox3 moonbox3 added this pull request to the merge queue May 22, 2026
Merged via the queue into microsoft:main with commit 6bc0dc5 May 22, 2026
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: Code sample for Sequential Workflow does not work

4 participants