This commit is contained in:
LuckVd 2026-10-14 10:49:13 -05:00 • committed by GitHub
commit 9ce8bbb101
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 1 deletions

View file

@ -55,7 +55,12 @@ OUTCOME_LABELS: dict[str, str] = {
}
#: Statuses that mean the agent stopped early rather than finishing its task.
_INCOMPLETE_AGENT_STATUSES = frozenset({"crashed", "stopped", "running", "waiting"})
#: ``failed`` and ``budget_paused`` are in ``core.agents.Status`` too, and an
#: agent wearing either never finished the surfaces it held, so they count as
#: incomplete here just like ``crashed`` does.
_INCOMPLETE_AGENT_STATUSES = frozenset(
{"crashed", "stopped", "running", "waiting", "failed", "budget_paused"}
)
#: Run statuses that mean the scan itself did not run to completion.
_INCOMPLETE_RUN_STATUSES = frozenset({"failed", "interrupted", "stopped", "running"})

View file

@ -154,6 +154,27 @@ def test_unfinished_agent_makes_the_record_partial() -> None:
assert "authz-tester" in doc["completeness"]["caveats"][0]
def test_failed_agent_makes_the_record_partial() -> None:
"""A failed agent must not let the record read as complete (#1458)."""
doc = _document(
agent_graph=_graph(statuses={"agent-1": "failed"}),
exit_reason="finished_by_tool",
)
assert doc["completeness"]["complete"] is False
assert "authz-tester" in doc["completeness"]["caveats"][0]
def test_budget_paused_agent_makes_the_record_partial() -> None:
doc = _document(
agent_graph=_graph(statuses={"agent-1": "budget_paused"}),
exit_reason="finished_by_tool",
)
assert doc["completeness"]["complete"] is False
assert "authz-tester" in doc["completeness"]["caveats"][0]
def test_failed_run_status_makes_the_record_partial() -> None:
doc = _document(
run_record={"run_id": "r1", "status": "failed"},