Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

Allow to pass timeout as float#941

Merged
Kludex merged 1 commit intomainmodelcontextprotocol/python-sdk:mainfrom
use-float-and-timedeltamodelcontextprotocol/python-sdk:use-float-and-timedeltaCopy head branch name to clipboard
Jun 12, 2025
Merged

Allow to pass timeout as float#941
Kludex merged 1 commit intomainmodelcontextprotocol/python-sdk:mainfrom
use-float-and-timedeltamodelcontextprotocol/python-sdk:use-float-and-timedeltaCopy head branch name to clipboard

Conversation

@Kludex
Copy link
Member

@Kludex Kludex commented Jun 12, 2025

I personally think that timedelta adds an unnecessary complexity, and is inconsistent with the SSE implementation. Even if it's considered the "right type", I don't think those timeouts should be used with any other unit than seconds/milliseconds.

I'm implementing it like this because it is the least breaking change, and @dsp-ant said he'd prefer it.


headers: dict[str, Any] | None = None,
timeout: timedelta = timedelta(seconds=30),
sse_read_timeout: timedelta = timedelta(seconds=60 * 5),
headers: dict[str, str] | None = None,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values are not Any, they are str.

@Kludex Kludex requested review from a team, dsp-ant and ihrpr June 12, 2025 06:46
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@Kludex Kludex merged commit 20dc0fb into main Jun 12, 2025
12 checks passed
@Kludex Kludex deleted the use-float-and-timedelta branch June 12, 2025 07:31
rm-openai pushed a commit to openai/openai-agents-python that referenced this pull request Jun 16, 2025
I replaced the `timedelta` parameters for MCP timeouts with `float`
values, addressing issue #845 .

Given that the MCP official repository has incorporated these changes in
[this PR](modelcontextprotocol/python-sdk#941),
updating the MCP version in openai-agents and specifying the timeouts as
floats should be enough.
niv-hertz pushed a commit to coralogix/openai-agents-python that referenced this pull request Jun 20, 2025
I replaced the `timedelta` parameters for MCP timeouts with `float`
values, addressing issue openai#845 .

Given that the MCP official repository has incorporated these changes in
[this PR](modelcontextprotocol/python-sdk#941),
updating the MCP version in openai-agents and specifying the timeouts as
floats should be enough.
niv-hertz added a commit to coralogix/openai-agents-python that referenced this pull request Jun 23, 2025
* Fix function_schema name override bug (openai#872)

## Summary
- ensure `name_override` is always used in `function_schema`
- test name override when docstring info is disabled

## Testing
- `make format`
- `make lint`
- `make mypy`
- `make tests`

Resolves openai#860
------
https://chatgpt.com/codex/tasks/task_i_684f1cf885b08321b4dd3f4294e24ca2

* adopted float instead of timedelta for timeout parameters (openai#874)

I replaced the `timedelta` parameters for MCP timeouts with `float`
values, addressing issue openai#845 .

Given that the MCP official repository has incorporated these changes in
[this PR](modelcontextprotocol/python-sdk#941),
updating the MCP version in openai-agents and specifying the timeouts as
floats should be enough.

* Prompts support (openai#876)

Add support for the new openai prompts feature.

* v0.0.18 (openai#878)

* Allow replacing AgentRunner and TraceProvider (openai#720)

* Prepare 0.0.19 release (openai#895)

* Added support for "return" handoffs (#1)

* Fix bug in Reasoning with `store=False`

---------

Co-authored-by: Rohan Mehta <rm@openai.com>
Co-authored-by: Daniele Morotti <58258368+DanieleMorotti@users.noreply.github.com>
Co-authored-by: pakrym-oai <pakrym@openai.com>
gold-crow-997 added a commit to gold-crow-997/open-ai-agent that referenced this pull request Sep 11, 2025
I replaced the `timedelta` parameters for MCP timeouts with `float`
values, addressing issue #845 .

Given that the MCP official repository has incorporated these changes in
[this PR](modelcontextprotocol/python-sdk#941),
updating the MCP version in openai-agents and specifying the timeouts as
floats should be enough.
JwCwn added a commit to JwCwn/open-ai-agents-python that referenced this pull request Dec 23, 2025
I replaced the `timedelta` parameters for MCP timeouts with `float`
values, addressing issue #845 .

Given that the MCP official repository has incorporated these changes in
[this PR](modelcontextprotocol/python-sdk#941),
updating the MCP version in openai-agents and specifying the timeouts as
floats should be enough.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent timeout and sse_read_timeout Types in sse_client and streamablehttp_client

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.