Allow to pass timeout as float#941
Merged
Kludex merged 1 commit intomainmodelcontextprotocol/python-sdk:mainfrom Jun 12, 2025
use-float-and-timedeltamodelcontextprotocol/python-sdk:use-float-and-timedeltaCopy head branch name to clipboard
Merged
Allow to pass timeout as float#941Kludex merged 1 commit intomainmodelcontextprotocol/python-sdk:mainfrom use-float-and-timedeltamodelcontextprotocol/python-sdk:use-float-and-timedeltaCopy head branch name to clipboard
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
commented
Jun 12, 2025
| 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, |
Member
Author
There was a problem hiding this comment.
The values are not Any, they are str.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I personally think that
timedeltaadds 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.