Skip to content
Open
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
1 change: 1 addition & 0 deletions src/sre_agent/eval/common/mocks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Shared mocks for evaluation suites."""
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
"""Mock CloudWatch tools for diagnosis quality evaluation."""
"""Mock CloudWatch tools shared across evaluation suites."""

from typing import Protocol

import opik

from sre_agent.core.models import LogEntry, LogQueryResult
from sre_agent.eval.diagnosis_quality.mocks.runtime import MockToolRuntime

MOCK_TIMESTAMP = "2026-01-01T00:00:00+00:00"


class _MockCloudWatchEntryLike(Protocol):
message: list[str]


class _CaseLike(Protocol):
mock_cloudwatch_entries: list[_MockCloudWatchEntryLike]


class MockRuntimeLike(Protocol):
"""Structural type required by the shared CloudWatch mock."""

case: _CaseLike


async def search_error_logs(
runtime: MockToolRuntime,
runtime: MockRuntimeLike,
log_group: str,
service_name: str,
time_range_minutes: int,
Expand Down Expand Up @@ -44,7 +59,7 @@ async def search_error_logs(
)


def _normalise_messages(runtime: MockToolRuntime) -> list[str]:
def _normalise_messages(runtime: MockRuntimeLike) -> list[str]:
"""Convert multiline fixture entries into non-empty log messages.

Returns:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Mock Slack tools for tool call evaluation."""
"""Mock Slack tools shared across evaluation suites."""

from typing import Any

Expand Down
33 changes: 0 additions & 33 deletions src/sre_agent/eval/diagnosis_quality/mocks/slack.py

This file was deleted.

4 changes: 2 additions & 2 deletions src/sre_agent/eval/diagnosis_quality/mocks/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from pydantic_ai import FunctionToolset

from sre_agent.core.models import LogQueryResult
from sre_agent.eval.diagnosis_quality.mocks import cloudwatch as cloudwatch_mocks
from sre_agent.eval.diagnosis_quality.mocks import slack as slack_mocks
from sre_agent.eval.common.mocks import cloudwatch as cloudwatch_mocks
from sre_agent.eval.common.mocks import slack as slack_mocks
from sre_agent.eval.diagnosis_quality.mocks.runtime import MockToolRuntime


Expand Down
58 changes: 0 additions & 58 deletions src/sre_agent/eval/tool_call/mocks/cloudwatch.py

This file was deleted.

4 changes: 2 additions & 2 deletions src/sre_agent/eval/tool_call/mocks/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from pydantic_ai import FunctionToolset

from sre_agent.core.models import LogQueryResult
from sre_agent.eval.tool_call.mocks import cloudwatch as cloudwatch_mocks
from sre_agent.eval.tool_call.mocks import slack as slack_mocks
from sre_agent.eval.common.mocks import cloudwatch as cloudwatch_mocks
from sre_agent.eval.common.mocks import slack as slack_mocks
from sre_agent.eval.tool_call.mocks.runtime import MockToolRuntime


Expand Down