File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed 
src/main/kotlin/com/coder/gateway/util Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -327,17 +327,16 @@ internal fun getMatchingAgent(
327327    }
328328
329329    //  If the agent is missing and the workspace has only one, use that.
330-     //  Prefer the ID over the name if both are set.
331-     val  agent = 
332-         if  (! parameters.agentID().isNullOrBlank()) {
333-             agents.firstOrNull { it.id.toString() ==  parameters.agentID() }
334-         } else  if  (! parameters.agentName().isNullOrBlank()) {
335-             agents.firstOrNull { it.name ==  parameters.agentName() }
336-         } else  if  (agents.size ==  1 ) {
337-             agents.first()
338-         } else  {
339-             null 
340-         }
330+     //  Prefer the name over the id if both are set.
331+     val  agent =  if  (! parameters.agentName().isNullOrBlank()) {
332+         agents.firstOrNull { it.name ==  parameters.agentName() }
333+     } else  if  (! parameters.agentID().isNullOrBlank()) {
334+         agents.firstOrNull { it.id.toString() ==  parameters.agentID() }
335+     } else  if  (agents.size ==  1 ) {
336+         agents.first()
337+     } else  {
338+         null 
339+     }
341340
342341    if  (agent ==  null ) {
343342        if  (! parameters.agentID().isNullOrBlank()) {
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ fun Map<String, String>.owner() = this[OWNER]
2929
3030fun  Map <String , String ?>.agentName () =  this [AGENT_NAME ]
3131
32+ @Deprecated(" Use the agent name instead"  )
3233fun  Map <String , String ?>.agentID () =  this [AGENT_ID ]
3334
3435fun  Map <String , String >.folder () =  this [FOLDER ]
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments