Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion openagent_eval/exceptions/diagnosis.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ def __init__(
details: Optional dictionary with additional error context.
step: The diagnosis step that failed (e.g., "blame_attribution").
"""
super().__init__(message, details)
error_details = details or {}
if step is not None:
error_details["step"] = step

super().__init__(message, error_details)
self.step = step


Expand Down
12 changes: 12 additions & 0 deletions tests/unit/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
DatasetError,
DatasetNotFoundError,
DatasetValidationError,
DiagnosisExecutionError,
InvalidDatasetError,
MetricError,
MetricExecutionError,
Expand Down Expand Up @@ -130,6 +131,17 @@ def test_timeout_error_preserves_zero_timeout(self) -> None:
assert error.details["timeout_seconds"] == 0.0


class TestDiagnosisError:
"""Tests for diagnosis errors."""

def test_execution_error_includes_step_in_details(self) -> None:
"""Test that the failed step is visible in error details."""
error = DiagnosisExecutionError("Failed", step="blame_attribution")

assert error.step == "blame_attribution"
assert error.details["step"] == "blame_attribution"


class TestProviderError:
"""Tests for provider errors."""

Expand Down
Loading