Skip to content

Commit 1a24a4f

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 430b67e commit 1a24a4f

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 AgentRunner
89
from ldai.providers.runner import Runner
@@ -66,7 +67,12 @@ async def _run_and_track(eval_task: asyncio.Task) -> List[JudgeResult]:
6667
results = await eval_task
6768
for r in results:
6869
if r.success:
69-
tracker.track_judge_result(r)
70+
try:
71+
tracker.track_judge_result(r)
72+
except Exception:
73+
pass
74+
else:
75+
log.warning("Judge evaluation failed: %s", r.error_message)
7076
return results
7177

7278
return asyncio.create_task(_run_and_track(evaluator_task))

0 commit comments

Comments
 (0)