Repository navigation
Description
Description
When a group chat is driven by an orchestrator agent (GroupChatBuilder(orchestrator_agent=...)), the next_speaker the agent returns is never checked against the registered participants. If the model gets a name slightly wrong, for example "Writer" for a participant called "writer", the orchestrator sends the request to an executor that does not exist. The workflow then goes idle with no output and no error.
retry_attempts doesn't help either. The only check in AgentBasedGroupChatOrchestrator._invoke_agent is for a missing next_speaker, so a wrong name never counts as a failed attempt.
The selection-function orchestrator already raises RuntimeError("Selection function returned unknown participant ...") in this case, and Magentic handles it with Invalid next speaker. The agent-driven group chat is the only pattern that lets it through.
Expected: an error naming the unknown participant, like the selection-function group chat raises. When retry_attempts is set, the bad pick should count as a failed attempt so the manager gets another chance.
Steps to reproduce: run the code sample below.
Code Sample
import asyncio
import json
from typing import Any
from agent_framework import Agent, AgentResponse, BaseAgent, Message
from agent_framework.orchestrations import GroupChatBuilder
class Writer(BaseAgent):
async def run(self, messages: Any = None, *, stream: bool = False, **kwargs: Any) -> AgentResponse:
return AgentResponse(messages=[Message(role="assistant", contents=["draft"], author_name=self.name)])
class Manager(Agent):
"""Stands in for an LLM manager that gets the casing of a participant name wrong."""
async def run(self, messages: Any = None, **kwargs: Any) -> AgentResponse:
choice = {"terminate": False, "reason": "delegate", "next_speaker": "Writer", "final_message": None}
return AgentResponse(messages=[Message(role="assistant", contents=[json.dumps(choice)])])
async def main() -> None:
workflow = GroupChatBuilder(
participants=[Writer(name="writer")],
orchestrator_agent=Manager(client=object(), name="manager"),
).build()
result = await workflow.run("Write a haiku")
print(result.get_final_state(), result.get_outputs())
asyncio.run(main())Error Messages / Stack Traces
No error is raised, which is the problem. The script prints:
WorkflowRunState.IDLE []Package Versions
agent-framework-core: 1.20.0, agent-framework-orchestrations: 1.3.0 (main at e9857bd)
Python Version
Python 3.13
Additional Context
I'd like to work on this one and have a small fix ready.
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Oct 3, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
Repro:
python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py::AgentBasedGroupChatOrchestrator._invoke_agentaccepts a nonemptynext_speakerabsent from the participant registry, and_handle_messagesroutes it to a nonexistent executor. Minimal repro: registerwriter, returnWriterfrom a stub orchestrator agent, and awaitworkflow.run(); it returnsWorkflowRunState.IDLEwith[]instead of raising. Because no exception occurs inside_invoke_agent, configured retries are not consumed.python/packages/orchestrations/tests/test_group_chat.py::test_agent_manager_rejects_unknown_participant1.3.01.3.0