Skip to content

Comments

Python: Fix workflow samples for bugbash: part 1#4055

Merged
TaoChenOSU merged 3 commits intomicrosoft:mainfrom
TaoChenOSU:taochen/python-fix-workflow-samples-part-1
Feb 18, 2026
Merged

Python: Fix workflow samples for bugbash: part 1#4055
TaoChenOSU merged 3 commits intomicrosoft:mainfrom
TaoChenOSU:taochen/python-fix-workflow-samples-part-1

Conversation

@TaoChenOSU
Copy link
Contributor

@TaoChenOSU TaoChenOSU commented Feb 18, 2026

Motivation and Context

Fix workflow samples

Description

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.

@TaoChenOSU TaoChenOSU self-assigned this Feb 18, 2026
Copilot AI review requested due to automatic review settings February 18, 2026 22:26
@TaoChenOSU TaoChenOSU added python samples Issue relates to the samples labels Feb 18, 2026
@github-actions github-actions bot changed the title Fix workflow samples for bugbash: part 1 Python: Fix workflow samples for bugbash: part 1 Feb 18, 2026
Copy link
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 pull request fixes various issues in workflow samples discovered during a bugbash, focusing on correcting parameters, improving comments, fixing paths, refactoring event handling logic, and adding test coverage for middleware functionality.

Changes:

  • Fixed parameter names and configuration values in workflow agent samples
  • Corrected file system path calculation for workflow loading
  • Refactored human-in-the-loop event handling patterns
  • Added test coverage for handoff middleware functionality
  • Updated comments and documentation to match actual workflow behavior

Reviewed changes

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

Show a summary per file
File Description
python/samples/03-workflows/tool-approval/group_chat_builder_tool_approval.py Updated max_rounds from 4 to 2 and revised comments to explain the rationale for preventing empty message errors
python/samples/03-workflows/orchestrations/magentic.py Added blank line for formatting consistency
python/samples/03-workflows/human-in-the-loop/agents_with_HITL.py Corrected sample description from "AzureOpenAI Chat Agents" to "Azure AI Agents"
python/samples/03-workflows/declarative/human_in_loop/main.py Refactored event handling to properly check event type before casting ExternalInputRequest
python/samples/03-workflows/declarative/deep_research/main.py Fixed path calculation by removing one extra parent level (was going outside repo root)
python/samples/03-workflows/control-flow/workflow_cancellation.py Changed asyncio.create_task to asyncio.ensure_future and reformatted workflow builder chain
python/samples/03-workflows/agents/workflow_as_agent_human_in_the_loop.py Fixed Worker parameter from chat_client to client and changed feedback value from "Approved" to empty string
python/samples/03-workflows/agents/concurrent_workflow_as_agent.py Removed unused clear_and_redraw function
python/samples/03-workflows/agents/azure_chat_agents_tool_calls_with_feedback.py Refactored to add AsyncIterable import, remove unused AgentResponseUpdate, simplify event handling with consume_stream helper, and fix workflow run loop logic
python/packages/orchestrations/tests/test_handoff.py Added imports and two new test cases for auto handoff middleware behavior
python/packages/orchestrations/agent_framework_orchestrations/_handoff.py Fixed handoff middleware to properly parse function results using FunctionTool.parse_result

@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/orchestrations/agent_framework_orchestrations
   _handoff.py3395882%105–106, 108, 163–173, 175, 177, 179, 184, 282, 335, 360, 388, 396–397, 411, 462–463, 495, 501, 505, 509–510, 548–550, 555–557, 673, 676, 683, 688, 750, 755, 762, 772, 774, 793, 795, 877–878, 910–911, 993, 1000, 1072–1073, 1075
TOTAL21209333184% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
4178 239 💤 0 ❌ 0 🔥 1m 16s ⏱️

@TaoChenOSU TaoChenOSU enabled auto-merge February 18, 2026 22:55
@TaoChenOSU TaoChenOSU added this pull request to the merge queue Feb 18, 2026
Merged via the queue into microsoft:main with commit 7cee839 Feb 18, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python samples Issue relates to the samples

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants