Skip to content

chore: increase httpx timeout to 15 minutes#5

Open
shtratos wants to merge 1 commit intomainfrom
bump-timeout
Open

chore: increase httpx timeout to 15 minutes#5
shtratos wants to merge 1 commit intomainfrom
bump-timeout

Conversation

@shtratos
Copy link
Copy Markdown
Owner

Increase read and total timeout from 60s/120s to 900s (15 minutes) to better handle long-running proxy requests.

Increase read and total timeout from 60s/120s to 900s (15 minutes)
to better handle long-running proxy requests.
Copilot AI review requested due to automatic review settings November 27, 2025 16:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR increases the httpx timeout configuration in the proxy's HTTP client from 60s/120s (default/read) to 900s (15 minutes) to accommodate long-running requests when proxying to the Anthropic API. This is a configuration change to better handle streaming responses and tool invocations that may take significant time to complete.

Key changes:

  • Increased default timeout from 60s to 900s (15 minutes)
  • Increased read timeout from 120s to 900s (15 minutes)
  • Increased connect timeout from 10s to 30s

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

self._client = httpx.AsyncClient(
base_url=base_url,
timeout=httpx.Timeout(60.0, connect=10.0, read=120.0),
timeout=httpx.Timeout(900.0, connect=30.0, read=900.0),
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

The httpx.Timeout constructor signature is Timeout(timeout=None, connect=None, read=None, write=None, pool=None) where the first positional argument is the default timeout. Setting both the default (900s) and read (900s) to the same value is redundant. Consider either using only the default timeout httpx.Timeout(900.0, connect=30.0) or explicitly setting write timeout as well if needed: httpx.Timeout(connect=30.0, read=900.0, write=900.0).

Suggested change
timeout=httpx.Timeout(900.0, connect=30.0, read=900.0),
timeout=httpx.Timeout(900.0, connect=30.0),

Copilot uses AI. Check for mistakes.
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.

2 participants