diff --git a/src/utils/agents/streaming.py b/src/utils/agents/streaming.py index ef64a75b6..07b15f7e1 100644 --- a/src/utils/agents/streaming.py +++ b/src/utils/agents/streaming.py @@ -117,7 +117,7 @@ async def retrieve_agent_response_generator( turn_summary, ) - agent = build_agent(context.client, responses_params) + agent = build_agent(context.client, responses_params, configuration.skills) return ( agent_response_generator( diff --git a/tests/unit/utils/agents/test_streaming.py b/tests/unit/utils/agents/test_streaming.py index 1eb1da049..b93c314cc 100644 --- a/tests/unit/utils/agents/test_streaming.py +++ b/tests/unit/utils/agents/test_streaming.py @@ -203,6 +203,14 @@ def patch_recording_metrics_fixture(mocker: MockerFixture) -> None: mocker.patch("utils.agents.query.recording.record_llm_call") +@pytest.fixture(name="patch_streaming_configuration") +def patch_streaming_configuration_fixture(mocker: MockerFixture) -> None: + """Patch streaming module configuration for isolated agent streaming tests.""" + mock_config = mocker.MagicMock() + mock_config.skills = None + mocker.patch("utils.agents.streaming.configuration", mock_config) + + @pytest.fixture(autouse=True, name="stream_interrupt_mocks") def stream_interrupt_mocks_fixture(mocker: MockerFixture) -> dict[str, Any]: """Patch stream interrupt registry and deregister for wrapper tests.""" @@ -479,6 +487,7 @@ def test_part_end_native_tool_call_returns_none_when_skipped( assert not turn_state.turn_summary.tool_calls +@pytest.mark.usefixtures("patch_streaming_configuration") class TestRetrieveAgentResponseGenerator: """Tests for retrieve_agent_response_generator."""