@@ -4017,14 +4017,19 @@ def batch_status(
40174017
40184018 if batch_id :
40194019 # Show specific batch
4020- # Find by partial ID
4021- all_batches = conductor .list_batches (workspace , limit = 100 )
4022- matching = [b for b in all_batches if b .id .startswith (batch_id )]
4020+ # Find by partial ID (SQL LIKE — no cap, resolves batches beyond 100)
4021+ matching = conductor .find_batch_by_prefix (workspace , batch_id )
40234022
40244023 if not matching :
40254024 console .print (f"[red]Error:[/red] No batch found matching '{ batch_id } '" )
40264025 raise typer .Exit (1 )
40274026
4027+ if len (matching ) > 1 :
4028+ console .print (f"[red]Error:[/red] Multiple batches match '{ batch_id } ':" )
4029+ for b in matching [:5 ]:
4030+ console .print (f" { b .id [:8 ]} ({ b .status .value } )" )
4031+ raise typer .Exit (1 )
4032+
40284033 batch = matching [0 ]
40294034
40304035 # Status color
@@ -4162,14 +4167,19 @@ def batch_stop(
41624167 try :
41634168 workspace = get_workspace (path )
41644169
4165- # Find by partial ID
4166- all_batches = conductor .list_batches (workspace , limit = 100 )
4167- matching = [b for b in all_batches if b .id .startswith (batch_id )]
4170+ # Find by partial ID (SQL LIKE — no cap, resolves batches beyond 100)
4171+ matching = conductor .find_batch_by_prefix (workspace , batch_id )
41684172
41694173 if not matching :
41704174 console .print (f"[red]Error:[/red] No batch found matching '{ batch_id } '" )
41714175 raise typer .Exit (1 )
41724176
4177+ if len (matching ) > 1 :
4178+ console .print (f"[red]Error:[/red] Multiple batches match '{ batch_id } ':" )
4179+ for b in matching [:5 ]:
4180+ console .print (f" { b .id [:8 ]} ({ b .status .value } )" )
4181+ raise typer .Exit (1 )
4182+
41734183 batch = matching [0 ]
41744184
41754185 if batch .status .value not in ("PENDING" , "RUNNING" ):
@@ -4231,19 +4241,18 @@ def batch_resume(
42314241 try :
42324242 workspace = get_workspace (path )
42334243
4234- # Find by partial ID
4235- all_batches = conductor .list_batches (workspace , limit = 100 )
4236- matching = [b for b in all_batches if b .id .startswith (batch_id )]
4244+ # Find by partial ID (SQL LIKE — no cap, resolves batches beyond 100)
4245+ matching = conductor .find_batch_by_prefix (workspace , batch_id )
42374246
42384247 if not matching :
42394248 console .print (f"[red]Error:[/red] No batch found matching '{ batch_id } '" )
42404249 raise typer .Exit (1 )
42414250
42424251 if len (matching ) > 1 :
4243- console .print (f"[yellow]Warning :[/yellow ] Multiple batches match '{ batch_id } ':" )
4252+ console .print (f"[red]Error :[/red ] Multiple batches match '{ batch_id } ':" )
42444253 for b in matching [:5 ]:
4245- console .print (f" - { b .id [:8 ]} ({ b .status .value } )" )
4246- console . print ( "Using the most recent match." )
4254+ console .print (f" { b .id [:8 ]} ({ b .status .value } )" )
4255+ raise typer . Exit ( 1 )
42474256
42484257 batch = matching [0 ]
42494258
@@ -4430,14 +4439,19 @@ def _update_progress(progress: BatchProgress, event: events.Event) -> None:
44304439 try :
44314440 workspace = get_workspace (path )
44324441
4433- # Find batch by partial ID
4434- all_batches = conductor .list_batches (workspace , limit = 100 )
4435- matching = [b for b in all_batches if b .id .startswith (batch_id )]
4442+ # Find batch by partial ID (SQL LIKE — no cap, resolves batches beyond 100)
4443+ matching = conductor .find_batch_by_prefix (workspace , batch_id )
44364444
44374445 if not matching :
44384446 console .print (f"[red]Error:[/red] No batch found matching '{ batch_id } '" )
44394447 raise typer .Exit (1 )
44404448
4449+ if len (matching ) > 1 :
4450+ console .print (f"[red]Error:[/red] Multiple batches match '{ batch_id } ':" )
4451+ for b in matching [:5 ]:
4452+ console .print (f" { b .id [:8 ]} ({ b .status .value } )" )
4453+ raise typer .Exit (1 )
4454+
44414455 batch = matching [0 ]
44424456 batch_id_short = batch .id [:8 ]
44434457
0 commit comments