Skip to content

Commit c343602

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 1d9c790 commit c343602

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, Union
55

6+
from ldai import log
67
from ldai.models import AIAgentConfig
78
from ldai.providers import AgentResult, AgentRunner
89
from ldai.providers.runner import Runner
@@ -68,7 +69,12 @@ async def _run_and_track(eval_task: asyncio.Task) -> List[JudgeResult]:
6869
results = await eval_task
6970
for r in results:
7071
if r.success:
71-
tracker.track_judge_result(r)
72+
try:
73+
tracker.track_judge_result(r)
74+
except Exception:
75+
pass
76+
else:
77+
log.warning("Judge evaluation failed: %s", r.error_message)
7278
return results
7379

7480
return asyncio.create_task(_run_and_track(evaluator_task))

0 commit comments

Comments
 (0)