fix: Stop passing invalid argument during SSE client initialization (#3938) #3939
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses #3938.
Description
When initializing an MCP client while creating a connection to an MCP server using SSE transport, an invalid argument (
terminate_on_close) is passed. The argument is valid for streamable HTTP transport, but is not supported for SSE transport. This results in a crash when trying to run an agent that connects to an MCP server using SSE transport.Changes
terminate_on_closeargument is no longer passed during the initialization of MCP's SSE transportNote
Remove unsupported
terminate_on_closearg from SSE client init to prevent crashes.terminate_on_closeargument when initializingmcp.client.sse.sse_clientinlib/crewai/src/crewai/mcp/transports/sse.py, preventing SSE connection failures.Written by Cursor Bugbot for commit 4a78ae1. This will update automatically on new commits. Configure here.