Skip to content

Commit a198003

Browse files
committed
fix: Isolate tracking failures and log failed judge evaluations in agent
Mirror the managed_model.py fix in managed_agent.py: wrap tracker.track_judge_result() in try/except so a tracking failure does not destroy successfully computed evaluation results, and log a warning when a judge evaluation fails (r.success is False) so failures are visible rather than silently skipped.
1 parent 9cee75f commit a198003

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/sdk/server-ai/src/ldai/managed_agent.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import asyncio
44
from typing import List
55

6+
from ldai import log
67
from ldai.models import AIAgentConfig
78
from ldai.providers.runner import Runner
89
from ldai.providers.types import JudgeResult, ManagedResult
@@ -65,7 +66,12 @@ async def _run_and_track(eval_task: asyncio.Task) -> List[JudgeResult]:
6566
results = await eval_task
6667
for r in results:
6768
if r.success:
68-
tracker.track_judge_result(r)
69+
try:
70+
tracker.track_judge_result(r)
71+
except Exception:
72+
pass
73+
else:
74+
log.warning("Judge evaluation failed: %s", r.error_message)
6975
return results
7076

7177
return asyncio.create_task(_run_and_track(evaluator_task))

0 commit comments

Comments
 (0)