fix: give final acceptance a shared retry budget and diagnostics

This commit is contained in:
chenmingxuan committed 2026-10-18 20:51:19 +08:00
1 parent 50638d4130
commit 32441e79c4
18 files changed
+779 -40

No files matched your search

+5 -10
View File
@@ -1,10 +1,10 @@
"""Flash's exit-only acceptance check uses the same read-only Checker as Pro."""
import asyncio
from pathlib import Path
from artemis.agents.checker.checker import run_final_check
from artemis.context import ArtemisContext
from artemis.llm.diagnostics import final_review_error_text
from artemis.graph.checkpoints import (
RunOutcome,
TestSummary,
@@ -14,6 +14,7 @@ from artemis.graph.checkpoints import (
write_run_outcome,
)
from artemis.runtime.case_result import CaseTestResult, resolve_case_result
from artemis.services.llm import final_review_budget
from artemis.utils.logger import get_logger
from artemis.utils.notes import save_verified_note
@@ -50,7 +51,6 @@ async def settle_flash_outcome(
logger.warning(f"Flash 最终答复保存失败:{exc}")
delivery = {"ok": False, "verified": False, "error": str(exc)}
if final_check_enabled(ctx):
timeout = float(getattr(ctx.execution_setup, "checkpoint_timeout", 180.0))
publish_checker_event(
ctx,
{
@@ -63,8 +63,8 @@ async def settle_flash_outcome(
},
)
try:
report = await asyncio.wait_for(
run_final_check(
report = await final_review_budget(ctx, attempt_id="final#1").run(
lambda: run_final_check(
ctx,
goal=goal,
plan_text="",
@@ -74,7 +74,6 @@ async def settle_flash_outcome(
execution_report=execution_report,
report_delivery=delivery,
),
timeout=timeout,
)
result = report.test_result
if report.report_corrections and directory:
@@ -101,11 +100,7 @@ async def settle_flash_outcome(
},
)
except Exception as exc:
detail = (
f"超过 {timeout:g} 秒"
if isinstance(exc, TimeoutError)
else f"{type(exc).__name__}: {exc}"
)
detail = final_review_error_text(exc)
logger.warning(f"Flash 测试验收未完成:{detail}")
result = CaseTestResult(
status="inconclusive", reason=f"操作已结束,但测试验收未完成:{detail}。"