Skip to content

AgentExecutionStep.might_yield raises NotImplementedError for A2AAgent #141

@groganz

Description

@groganz

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

  1. Create a flow with an A2AAgent inside an AgentExecutionStep (i.e. an AgentNode in agent.json that references a child agent served over A2A).
  2. Call AgentSpecLoader.load_json(spec_str) to convert the spec, then A2AServer.serve_agent(agent).
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions