@@ -3558,6 +3558,75 @@ def test_process_tool_missing_output_schema(self):
35583558 assert isinstance (tool_resource , AgentProcessToolResourceConfig )
35593559 assert tool_resource .output_schema == {"type" : "object" , "properties" : {}}
35603560
3561+ def test_flow_tool_type_enum_value (self ):
3562+ """AgentToolType.FLOW exists with the wire value 'Flow' and is case-insensitive."""
3563+ assert AgentToolType .FLOW .value == "Flow"
3564+ assert AgentToolType ("flow" ) is AgentToolType .FLOW
3565+ assert AgentToolType ("FLOW" ) is AgentToolType .FLOW
3566+
3567+ def test_flow_tool_resource_deserialization (self ):
3568+ """A resource with type='Flow' is parsed as AgentProcessToolResourceConfig."""
3569+ resources = [
3570+ {
3571+ "$resourceType" : "tool" ,
3572+ "type" : "Flow" ,
3573+ "id" : "flow-tool-1" ,
3574+ "inputSchema" : {
3575+ "type" : "object" ,
3576+ "properties" : {"input" : {"type" : "string" }},
3577+ },
3578+ "outputSchema" : {"type" : "object" , "properties" : {}},
3579+ "arguments" : {},
3580+ "settings" : {"timeout" : 0 , "maxAttempts" : 0 , "retryDelay" : 0 },
3581+ "properties" : {
3582+ "processName" : "MyFlow" ,
3583+ "folderPath" : "/Shared/Flows" ,
3584+ },
3585+ "name" : "Flow Tool" ,
3586+ "description" : "Test Flow tool" ,
3587+ }
3588+ ]
3589+
3590+ json_data = self ._agent_dict_with_resources (resources )
3591+ config : AgentDefinition = TypeAdapter (AgentDefinition ).validate_python (
3592+ json_data
3593+ )
3594+
3595+ tool_resource = config .resources [0 ]
3596+ assert isinstance (tool_resource , AgentProcessToolResourceConfig )
3597+ assert tool_resource .type == AgentToolType .FLOW
3598+ assert tool_resource .properties .process_name == "MyFlow"
3599+ assert tool_resource .properties .folder_path == "/Shared/Flows"
3600+
3601+ def test_flow_tool_resource_case_insensitive (self ):
3602+ """A resource with lowercase type='flow' also deserializes via CaseInsensitiveEnum."""
3603+ resources = [
3604+ {
3605+ "$resourceType" : "tool" ,
3606+ "type" : "flow" ,
3607+ "id" : "flow-tool-2" ,
3608+ "inputSchema" : {"type" : "object" , "properties" : {}},
3609+ "outputSchema" : {"type" : "object" , "properties" : {}},
3610+ "arguments" : {},
3611+ "settings" : {"timeout" : 0 , "maxAttempts" : 0 , "retryDelay" : 0 },
3612+ "properties" : {
3613+ "processName" : "MyFlow" ,
3614+ "folderPath" : "/Shared/Flows" ,
3615+ },
3616+ "name" : "Flow Tool" ,
3617+ "description" : "Test Flow tool" ,
3618+ }
3619+ ]
3620+
3621+ json_data = self ._agent_dict_with_resources (resources )
3622+ config : AgentDefinition = TypeAdapter (AgentDefinition ).validate_python (
3623+ json_data
3624+ )
3625+
3626+ tool_resource = config .resources [0 ]
3627+ assert isinstance (tool_resource , AgentProcessToolResourceConfig )
3628+ assert tool_resource .type == AgentToolType .FLOW
3629+
35613630 def test_escalation_missing_escalation_type_defaults_to_zero (self ):
35623631 """Test that missing escalationType defaults to 0."""
35633632 resources = [
0 commit comments