Skip to content

feat(sdk): default HTTP timeout of 5s, overridable - #64

Draft
snopoke wants to merge 1 commit into
mainfrom
sk/http-timeout
Draft

feat(sdk): default HTTP timeout of 5s, overridable#64
snopoke wants to merge 1 commit into
mainfrom
sk/http-timeout

Conversation

@snopoke

@snopoke snopoke commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Settings.get_client() never passed a timeout to the generated client, whose own default is timeout=None — which httpx treats as no timeout rather than its 5s default. A hung connection to the API could therefore block a task forever.

Now defaults to 5s, overridable via init(timeout=...) or TASKBADGER_HTTP_TIMEOUT (the env var is what makes it reachable from the CLI, which builds Settings internally). httpx.Timeout instances pass through, so httpx.Timeout(None) is still an escape hatch for anyone who was relying on the old behaviour.

5s is a guess at a sane default — it's httpx's own, and these are small API calls — but it is a behaviour change for anyone whose API requests currently take longer than that.

The generated client was constructed without a timeout, which httpx reads
as "no timeout", so a stalled request could block a task indefinitely.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@snopoke snopoke added the feat New feature (feat:) label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature (feat:)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant