mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-08 08:25:09 +00:00
fix: address three review comments on env/cli handling
- write_env_file: remove .upper() to preserve original key case - load_env_vars: strip surrounding single/double quotes from values - constants.py: fix Ollama key_name from OPENAI_API_BASE to OLLAMA_HOST - _test_new_agents: replace asyncio.run() loop with new_event_loop + run_until_complete Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -864,6 +864,9 @@ def _test_new_agents(
|
||||
all_passed = True
|
||||
agents_tested: set[str] = set()
|
||||
|
||||
_loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(_loop)
|
||||
|
||||
for iteration in range(n_iterations):
|
||||
if n_iterations > 1:
|
||||
click.secho(f"\n Iteration {iteration + 1}/{n_iterations}", fg="cyan")
|
||||
@@ -876,10 +879,10 @@ def _test_new_agents(
|
||||
with ArtifactsSandbox():
|
||||
if verbose:
|
||||
with VerboseBenchmarkOutput():
|
||||
all_results = asyncio.run(_run_all())
|
||||
all_results = _loop.run_until_complete(_run_all())
|
||||
else:
|
||||
with SuppressBenchmarkOutput():
|
||||
all_results = asyncio.run(_run_all())
|
||||
all_results = _loop.run_until_complete(_run_all())
|
||||
finally:
|
||||
if not verbose:
|
||||
if progress is None:
|
||||
@@ -914,6 +917,8 @@ def _test_new_agents(
|
||||
f" [green bold]{job['agent_name']}: PASSED all {len(results)} cases >= {job['threshold']}[/green bold]"
|
||||
)
|
||||
|
||||
_loop.close()
|
||||
|
||||
if len(agents_tested) == 0:
|
||||
click.secho("No agents completed successfully.", fg="yellow")
|
||||
raise SystemExit(1)
|
||||
|
||||
Reference in New Issue
Block a user