Skip to content

Disable read timeout on default low-level HTTP clients - #40

Merged
cretz merged 2 commits into
mainfrom
cretz/client-no-default-timeout
Nov 9, 2026
Merged

cretz merged 2 commits into
mainfrom
cretz/client-no-default-timeout

Conversation

@cretz

@cretz cretz commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

🚀 What

  • Default low-level HTTP clients (inference, management, sandbox; sync and async) no longer have a read timeout, matching the JS and Go and Blaxel clients
  • Fixes httpx's 5s default breaking long-held calls (slow inference, waiting process runs, log streams, filesystem watch, process wait)

💻 How

  • Pass httpx.Timeout(5.0, read=None) when creating the default client; connect, write, and pool keep httpx's 5s
  • Clients passed via http_client_override are unchanged

🔬 Testing

  • None added; config-only change

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the changes disabling read timeouts on the SDK’s default HTTP clients.

No open issues 🎉

What changed in this PR

Disables read timeouts on the SDK’s default low-level HTTP clients so long-running requests and streams are not interrupted by httpx’s five-second read timeout.

Changes:

  • Applies httpx.Timeout(5.0, read=None) to synchronous and asynchronous inference, management, and sandbox clients.
  • Preserves five-second connect, write, and pool timeouts.
  • Leaves clients supplied through http_client_override unchanged.
File Description
baseten/​client/​_sandbox.py Disables default read timeouts for sandbox calls and streams.
baseten/​client/​_management.py Disables default read timeouts for management requests.
baseten/​client/​_inference.py Disables default read timeouts for long-running inference requests.

Review effort: Balanced

@cretz

cretz commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Doing admin bypass, the sandbox tests are too flaky

@cretz
cretz merged commit e28ff28 into main Nov 9, 2026
9 of 13 checks passed
@cretz
cretz deleted the cretz/client-no-default-timeout branch November 9, 2026 18: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.

3 participants