Skip to content

Limit hanging stream timeout#1197

Merged
ValentaTomas merged 6 commits into
mainfrom
stream-hang-timeout
Mar 18, 2026
Merged

Limit hanging stream timeout#1197
ValentaTomas merged 6 commits into
mainfrom
stream-hang-timeout

Conversation

@ValentaTomas
Copy link
Copy Markdown
Member

@ValentaTomas ValentaTomas commented Mar 10, 2026

Note

Medium Risk
Changes request timeout semantics for server-stream calls by adding write and conditional read timeouts, which could alter behavior for long-running/slow streams but is limited to client-side networking configuration.

Overview
Improves timeout handling for server-stream requests in the Python SDK. Client._prepare_server_stream_request now builds a richer httpcore timeout extension: request_timeout applies to connect, pool, and write, and the separate timeout parameter is mapped to a read timeout (to help prevent hanging streams).

Adds a changeset to publish a patch release documenting the updated request_timeout behavior.

Written by Cursor Bugbot for commit e66ef8e. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 10, 2026

🦋 Changeset detected

Latest commit: e66ef8e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@e2b/python-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

Package Artifacts

Built from bb9ae51. Download artifacts from this workflow run.

JS SDK (e2b@2.14.2-stream-hang-timeout.0):

npm install ./e2b-2.14.2-stream-hang-timeout.0.tgz

CLI (@e2b/cli@2.8.2-stream-hang-timeout.0):

npm install ./e2b-cli-2.8.2-stream-hang-timeout.0.tgz

Python SDK (e2b==2.15.2+stream-hang-timeout):

pip install ./e2b-2.15.2+stream.hang.timeout-py3-none-any.whl

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 10, 2026

Package Artifacts

Built from 7175dc0. Download artifacts from this workflow run.

JS SDK (e2b@2.14.2-stream-hang-timeout.0):

npm install ./e2b-2.14.2-stream-hang-timeout.0.tgz

CLI (@e2b/cli@2.8.2-stream-hang-timeout.0):

npm install ./e2b-cli-2.8.2-stream-hang-timeout.0.tgz

Python SDK (e2b==2.15.2+stream-hang-timeout):

pip install ./e2b-2.15.2+stream.hang.timeout-py3-none-any.whl

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4d0fa580c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/python-sdk/e2b_connect/client.py Outdated
if request_timeout is not None:
timeout_ext["connect"] = request_timeout
timeout_ext["pool"] = request_timeout
timeout_ext["write"] = request_timeout
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This write timeout should be how long the "write" to the server we do can take. It should be minimal, as it is not streamed.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread packages/python-sdk/e2b_connect/client.py
Copy link
Copy Markdown
Contributor

@matthewlouisbrockman matthewlouisbrockman left a comment

Choose a reason for hiding this comment

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

makes sense, using the timeout for all the timeouts you can have.

@mishushakov
Copy link
Copy Markdown
Member

add a changeset pls

@ValentaTomas ValentaTomas enabled auto-merge (squash) March 12, 2026 01:53
@ValentaTomas ValentaTomas merged commit 710fae6 into main Mar 18, 2026
120 of 167 checks passed
@ValentaTomas ValentaTomas deleted the stream-hang-timeout branch March 18, 2026 05:25
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.

4 participants