Python: [BREAKING] Renamed AgentProtocol to SupportsAgentRun (#3717)

* Renamed AgentProtocol to AgentLike

* Resolved comments

* Renamed AgentLike to SupportsAgentRun

* Resolved comments
This commit is contained in:
Dmytro Struk
2026-02-06 17:53:21 +00:00
committed by GitHub
parent ac17adb595
commit 15256bb616
55 changed files with 354 additions and 354 deletions
@@ -7,7 +7,6 @@ from typing import Any, ClassVar, cast
import pytest
from agent_framework import (
AgentProtocol,
AgentResponse,
AgentResponseUpdate,
AgentThread,
@@ -15,6 +14,7 @@ from agent_framework import (
ChatMessage,
Content,
Executor,
SupportsAgentRun,
Workflow,
WorkflowCheckpoint,
WorkflowCheckpointException,
@@ -576,7 +576,7 @@ class StubAssistantsAgent(BaseAgent):
)
async def _collect_agent_responses_setup(participant: AgentProtocol) -> list[ChatMessage]:
async def _collect_agent_responses_setup(participant: SupportsAgentRun) -> list[ChatMessage]:
captured: list[ChatMessage] = []
wf = (
@@ -1121,10 +1121,10 @@ async def test_magentic_with_agent_factory():
"""Test workflow creation using agent_factory for StandardMagenticManager."""
factory_call_count = 0
def agent_factory() -> AgentProtocol:
def agent_factory() -> SupportsAgentRun:
nonlocal factory_call_count
factory_call_count += 1
return cast(AgentProtocol, StubManagerAgent())
return cast(SupportsAgentRun, StubManagerAgent())
participant = StubAgent("agentA", "reply from agentA")
workflow = (
@@ -1239,10 +1239,10 @@ def test_magentic_agent_factory_with_standard_manager_options():
"""Test that agent_factory properly passes through standard manager options."""
factory_call_count = 0
def agent_factory() -> AgentProtocol:
def agent_factory() -> SupportsAgentRun:
nonlocal factory_call_count
factory_call_count += 1
return cast(AgentProtocol, StubManagerAgent())
return cast(SupportsAgentRun, StubManagerAgent())
# Custom options to verify they are passed through
custom_max_stall_count = 5