Skip to content

Use total_seconds instead of seconds on timeout #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2025
Merged
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
8 changes: 5 additions & 3 deletions src/mcp/client/streamable_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ async def handle_get_stream(
self.url,
headers=headers,
timeout=httpx.Timeout(
self.timeout.seconds, read=self.sse_read_timeout.seconds
self.timeout.total_seconds(),
read=self.sse_read_timeout.total_seconds(),
),
) as event_source:
event_source.response.raise_for_status()
Expand Down Expand Up @@ -226,7 +227,7 @@ async def _handle_resumption_request(self, ctx: RequestContext) -> None:
self.url,
headers=headers,
timeout=httpx.Timeout(
self.timeout.seconds, read=ctx.sse_read_timeout.seconds
self.timeout.total_seconds(), read=ctx.sse_read_timeout.total_seconds()
),
) as event_source:
event_source.response.raise_for_status()
Expand Down Expand Up @@ -468,7 +469,8 @@ async def streamablehttp_client(
async with httpx_client_factory(
headers=transport.request_headers,
timeout=httpx.Timeout(
transport.timeout.seconds, read=transport.sse_read_timeout.seconds
transport.timeout.total_seconds(),
read=transport.sse_read_timeout.total_seconds(),
),
auth=transport.auth,
) as client:
Expand Down
Loading