mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-01 07:13:00 +00:00
fix: remove invalid param from sse client (#3980)
This commit is contained in:
@@ -66,7 +66,6 @@ class SSETransport(BaseTransport):
|
|||||||
self._transport_context = sse_client(
|
self._transport_context = sse_client(
|
||||||
self.url,
|
self.url,
|
||||||
headers=self.headers if self.headers else None,
|
headers=self.headers if self.headers else None,
|
||||||
terminate_on_close=True,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
read, write = await self._transport_context.__aenter__()
|
read, write = await self._transport_context.__aenter__()
|
||||||
|
|||||||
22
lib/crewai/tests/mcp/test_sse_transport.py
Normal file
22
lib/crewai/tests/mcp/test_sse_transport.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
"""Tests for SSE transport."""
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from crewai.mcp.transports.sse import SSETransport
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_sse_transport_connect_does_not_pass_invalid_args():
|
||||||
|
"""Test that SSETransport.connect() doesn't pass invalid args to sse_client.
|
||||||
|
|
||||||
|
The sse_client function does not accept terminate_on_close parameter.
|
||||||
|
"""
|
||||||
|
transport = SSETransport(
|
||||||
|
url="http://localhost:9999/sse",
|
||||||
|
headers={"Authorization": "Bearer test"},
|
||||||
|
)
|
||||||
|
|
||||||
|
with pytest.raises(ConnectionError) as exc_info:
|
||||||
|
await transport.connect()
|
||||||
|
|
||||||
|
assert "unexpected keyword argument" not in str(exc_info.value)
|
||||||
Reference in New Issue
Block a user