You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AgentExecutionStep.__init__ receives caller_input_mode=None for A2AAgent due to elif ordering in deserialization plugin #142
_builtins_deserialization_plugin.convert_to_wayflow checks isinstance(component, AgentSpecAgentNode) before isinstance(component, AgentSpecExtendedAgentNode). Because AgentSpecExtendedAgentNode inherits from AgentSpecAgentNode, the first branch always fires for any extended node type, passing caller_input_mode=None to AgentExecutionStep.__init__.
AgentExecutionStep.__init__ then raises a ValueError because None is not a valid CallerInputMode, which pyagentspec wraps into a TypeError via model_validator_with_error_accumulation.
Reproduction
Create an agent.json with an AgentNode that contains an A2AAgent component.
Call AgentSpecLoader.load_json(spec_str).
The deserialization raises:
TypeError: ValueError: 'error' required in context
The root cause: the elif chain in the deserialization plugin should check isinstance(component, AgentSpecExtendedAgentNode)beforeisinstance(component, AgentSpecAgentNode) so that the more-specific subclass branch is reached first.
Expected behaviour
A2AAgent nodes (which produce AgentSpecExtendedAgentNode instances) should be handled by the extended-node branch of the deserialization plugin, receiving the correct caller_input_mode value instead of None.
Workaround
We monkey-patch AgentExecutionStep.__init__ at container startup to default caller_input_mode=None to CallerInputMode.ALWAYS:
Activity