refactor: share INFRA stop-reason set from core.evolution

This commit is contained in:
2026-07-16 07:18:14 -04:00
parent b3ba11c7a5
commit 6911c83d66
4 changed files with 20 additions and 10 deletions
+3 -3
View File
@@ -53,7 +53,7 @@ if TYPE_CHECKING:
_SPAN_EVAL_TOOLS: frozenset[str] = frozenset({"view_node", "search_similar", "observe_frame"})
"""span 级评估涵盖的工具集合。"""
_INFRA_STOP_REASONS: frozenset[str] = frozenset({"error", "parse_error"})
INFRA_STOP_REASONS: frozenset[str] = frozenset({"error", "parse_error"})
"""执行/解析层失败导致排除的 stop_reason 集合。"""
@@ -2007,7 +2007,7 @@ def _count_infra_excluded(
qids = [
row["question_id"]
for row in prediction_rows
if row.get("stop_reason") in _INFRA_STOP_REASONS
if row.get("stop_reason") in INFRA_STOP_REASONS
]
return len(qids), qids
@@ -2083,7 +2083,7 @@ async def run_diagnosis(
for row in all_predictions:
stop_reason = row.get("stop_reason")
if stop_reason in _INFRA_STOP_REASONS:
if stop_reason in INFRA_STOP_REASONS:
continue
if task_type_filter and row.get("task_type") not in task_type_filter:
continue