Skip to content

Python: Fix type hint for Case and Default#3985

Open
cecheta wants to merge 1 commit intomicrosoft:mainfrom
cecheta:case-typing
Open

Python: Fix type hint for Case and Default#3985
cecheta wants to merge 1 commit intomicrosoft:mainfrom
cecheta:case-typing

Conversation

@cecheta
Copy link
Member

@cecheta cecheta commented Feb 17, 2026

Motivation and Context

Closes #3974

Description

Case and Default should accept SupportsAgentRun as target, and should not accept str as it throws an error here.

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.

Copilot AI review requested due to automatic review settings February 17, 2026 11:12
@cecheta cecheta changed the title Fix type hint for Case and Default Python: Fix type hint for Case and Default Feb 17, 2026
@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   _types.py9989290%49, 58–59, 113, 118, 137, 139, 143, 147, 149, 151, 153, 171, 175, 201, 223, 228, 233, 237, 263, 267, 613–614, 985, 1047, 1064, 1082, 1087, 1105, 1115, 1132–1133, 1135, 1153–1154, 1156, 1163–1164, 1166, 1201, 1212–1213, 1215, 1253, 1480, 1532, 1623–1628, 1650, 1655, 1821, 1833, 2076, 2085, 2106, 2201, 2426, 2633, 2703, 2715, 2722, 2733, 2931–2933, 2936–2938, 2942, 2947, 2951, 3035–3037, 3066, 3120, 3124–3126, 3128, 3139–3140, 3143–3147, 3153
packages/core/agent_framework/_workflows
   _edge.py2292887%47, 69–70, 72, 167, 197, 446–447, 452, 456–461, 463–465, 581, 695, 702–704, 751, 779, 805, 859, 873
TOTAL20564324384% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3955 225 💤 0 ❌ 0 🔥 1m 12s ⏱️

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 PR fixes the type hints for Case and Default classes in the workflow package to correctly accept SupportsAgentRun instances as targets, resolving issue #3974.

Changes:

  • Updated Case.target and Default.target type hints from Executor | str to Executor | SupportsAgentRun
  • Added import for SupportsAgentRun from ._agents module
  • Reformatted tools type annotation in _types.py from multi-line to single-line

Reviewed changes

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

File Description
python/packages/core/agent_framework/_workflows/_edge.py Fixed type hints for Case and Default target parameter to accept SupportsAgentRun instead of str, and added required import
python/packages/core/agent_framework/_types.py Reformatted tools type annotation from multi-line to single-line

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]: Case and Default should support SupportsAgentRun as the target

2 participants