Summary
AgentExecutionStep.might_yield handles Agent, Swarm, ManagerWorkers, and OciAgent but raises NotImplementedError for A2AAgent, preventing any flow that contains an A2A step from being served via A2AServer.
Reproduction
- Create a flow with an
A2AAgent inside an AgentExecutionStep (i.e. an AgentNode in agent.json that references a child agent served over A2A).
- Call
AgentSpecLoader.load_json(spec_str) to convert the spec, then A2AServer.serve_agent(agent).
- On startup,
might_yield is evaluated and raises:
NotImplementedError: A2AAgent not supported in agent execution step
Expected behaviour
A2AAgent is a first-class agent type per the AgentSpec. might_yield should return True when caller_input_mode == CallerInputMode.ALWAYS (the same logic that applies to other agent types that can yield), allowing orchestrator flows to call child A2A agents without patching the runtime.
Workaround
We monkey-patch AgentExecutionStep.might_yield at container startup:
_orig_might_yield = AgentExecutionStep.might_yield.fget
def _patched_might_yield(self):
if isinstance(self.agent, A2AAgent):
return self.caller_input_mode == CallerInputMode.ALWAYS
return _orig_might_yield(self)
AgentExecutionStep.might_yield = property(_patched_might_yield)
Environment
wayflowcore[a2a]==26.1.1
- Python 3.11
Summary
AgentExecutionStep.might_yieldhandlesAgent,Swarm,ManagerWorkers, andOciAgentbut raisesNotImplementedErrorforA2AAgent, preventing any flow that contains an A2A step from being served viaA2AServer.Reproduction
A2AAgentinside anAgentExecutionStep(i.e. anAgentNodeinagent.jsonthat references a child agent served over A2A).AgentSpecLoader.load_json(spec_str)to convert the spec, thenA2AServer.serve_agent(agent).might_yieldis evaluated and raises:Expected behaviour
A2AAgentis a first-class agent type per the AgentSpec.might_yieldshould returnTruewhencaller_input_mode == CallerInputMode.ALWAYS(the same logic that applies to other agent types that can yield), allowing orchestrator flows to call child A2A agents without patching the runtime.Workaround
We monkey-patch
AgentExecutionStep.might_yieldat container startup:Environment
wayflowcore[a2a]==26.1.1