fix(evaluator): reject non-boolean notification decisions

This commit is contained in:
Shuhan Si authored and Xubin Ren committed 2026-10-03 19:10:44 +08:00
1 parent 03b880f256
commit e2cd6908c7
2 files changed
+26 -1

No files matched your search

+7 -1
View File
@@ -129,9 +129,15 @@ async def evaluate_response(
args = llm_response.tool_calls[0].arguments
should_notify = args.get("should_notify", default_notify)
if not isinstance(should_notify, bool):
logger.warning(
"evaluate_response: non-boolean should_notify, defaulting to notify={}",
default_notify,
)
return default_notify
reason = args.get("reason", "")
logger.info("evaluate_response: should_notify={}, reason={}", should_notify, reason)
return bool(should_notify)
return should_notify
except Exception:
logger.exception("evaluate_response failed, defaulting to notify={}", default_notify)