Feature Request: Add Configurable Network Timeouts to HTTP Clients
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 56/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- python
- Bereich
- backend-api-design
Rechercherichtung
Start by locating the initialization methods for Client, AsyncClient, OauthClient, and AsyncOauthClient, then check how they construct or accept httpx clients. Trace the existing README.md examples and project tests for custom client behavior. Done means all four clients support the documented timeout setting, custom httpx client settings remain intact, and the updated examples are included.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
The Problem
By default, the underlying httpx HTTP library used by this SDK applies a strict 5-second timeout to all network requests.
If an API method takes longer than 5 seconds to process-for example, generating a large PDF file, querying a heavy dataset, or doing operations over a slow network connection-the SDK will unexpectedly crash with a TimeoutException.
Currently, the only way for developers to fix this is to understand how httpx works underneath, build a custom httpx.Client() object with a custom timeout, and explicitly pass it into our SDK upon initialization. This is a bit too much boilerplate work for such a common requirement.
Proposed Solution
We should add a built-in timeout parameter directly into the initialization methods of all our clients (Client, AsyncClient, OauthClient, and AsyncOauthClient), giving it a safer default limit of 30.0 seconds.
Expected behavior:
# Before: Developers had to do all this
import httpx
custom_client = httpx.Client(timeout=60.0)
client = Client(token="abc", client=custom_client)
# After: Simple, clean SDK syntax
client = Client(token="abc", timeout=60.0)
Acceptance Criteria
- Add
timeout: float = 30.0toClientandAsyncClient. - Add
timeout: float = 30.0toOauthClientandAsyncOauthClient. - Pass this parameter into the underlying
httpxclient natively. - Ensure full backward compatibility—if a user manually passes a custom
httpxclient, their settings are preserved and not overridden. - Update
README.mdand PyPI docs with code examples showing how to configure the timeout. - Verify all existing unit tests pass cleanly.
Why this matters / Benefits
- Smarter Defaults: Bumping the default timeout from 5 to 30 seconds prevents the SDK from crashing during heavier, perfectly valid API workloads.
- Better Developer Experience (DX): Allows users to configure timeouts cleanly in one line of code without needing to learn the intricacies of the underlying
httpxlibrary.
- Vorherrschende Sprache
- Python
- Sterne
- 18
- Forks
- 4
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus openapi/openapi-python-sdk
-
Rename package to openapi-sdk (PyPI approval in progress)Evtl. vergeben @francescobianco hat das vor 106 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 15/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
openapi/openapi-python-sdk#20 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 42/100
-
good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
openapi/openapi-python-sdk#9 · 7 Kommentare ·
Alle Issues in openapi/openapi-python-sdk
Ähnliche Issues
-
[Bug]: LangGraph Store sync put bypasses namespace validationEvtl. vergeben @ktz03 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
volcengine/OpenViking#6050 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunkEvtl. vergeben @rodricksz4h5 hat das heute übernommen. Offenarea/streaming comp/gateway P2 type/security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NousResearch/hermes-agent#138245 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[oblt-aw][autodoc] Update user onboarding guide for mandatory trigger CODEOWNERS stepEvtl. vergeben @github-actions hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag
-
correction metadata
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
acl-org/acl-anthology#10378 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
cloudtrail_multi_region_enabled_logging_management_events fails when the advanced event selector has a custom nameEvtl. vergeben @12YYCCYY16 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
prowler-cloud/prowler#13033 ·
Maintainer antworten meist innerhalb von 1 Tag