@@ -433,10 +433,11 @@ def search_path_match_providers(search_path: str, providers: list[Provider]) ->
433433
434434def select_provider (search_path : str , providers : list [Provider ]):
435435 provider_candidates = search_path_match_providers (search_path , providers )
436- if len (provider_candidates ) != 1 :
437- provider_candidates = [f" - { c } " for c in provider_candidates ]
438- remove_providers_detail = ":\n " + "\n " .join (provider_candidates ) if provider_candidates else ""
439- raise ValueError (f"{ len (provider_candidates )} matching agents{ remove_providers_detail } " )
436+ if len (provider_candidates ) == 0 :
437+ raise ValueError (f"No agents matched '{ search_path } '" )
438+ if len (provider_candidates ) > 1 :
439+ candidates_detail = "\n " .join (f" - { c } " for c in provider_candidates )
440+ raise ValueError (f"Multiple agents matched '{ search_path } ':\n { candidates_detail } " )
440441 [selected_provider ] = provider_candidates .values ()
441442 return selected_provider
442443
@@ -520,10 +521,10 @@ async def stream_logs(
520521 ],
521522):
522523 """Stream agent provider logs. [Admin only]"""
523- announce_server_action (f"Streaming logs for '{ search_path } ' from" )
524524 async with configuration .use_platform_client ():
525- provider = select_provider (search_path , await Provider .list ()).id
526- async for message in Provider .stream_logs (provider ):
525+ provider = select_provider (search_path , await Provider .list ())
526+ announce_server_action (f"Streaming logs for '{ provider .agent_card .name } ' from" )
527+ async for message in Provider .stream_logs (provider .id ):
527528 print_log (message , ansi_mode = True )
528529
529530
0 commit comments