feat: Default requests to a 30 second timeout - #951
Open
razor-x wants to merge 1 commit into
Open
Conversation
Requests had no timeout, so a hung connection blocked the caller indefinitely. Axios defaults `timeout` to 0, which means no timeout at all, and the SDK never set it. Set the Axios `timeout` to 30 seconds, matching the API's own request timeout, and add a `timeout` option so callers can raise, lower, or disable it. Passing `timeout` through `axiosOptions` still wins, keeping the existing escape hatch authoritative. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMgDauUA2R9u2THCHmMgv1
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of a four-SDK change adding a default HTTP timeout (ruby, python, csharp).
Problem
Requests had no timeout, so a hung connection blocked the caller indefinitely. Axios defaults
timeoutto0, which means no timeout at all, and the SDK never set it.Changes
timeoutto 30 seconds by default, matching the API's own request timeout.timeoutoption, in milliseconds, so callers can raise, lower, or disable it.axiosOptions.timeoutstill wins over thetimeoutoption.Set
timeoutto0to disable it. A request that times out rejects with an AxiosECONNABORTEDerror and is retried according to the retry options.Behavior change
Requests that previously ran longer than 30 seconds will now fail with
ECONNABORTEDinstead of hanging. Thetimeoutoption is the opt-out.Testing
npm run typecheckand Prettier are clean. I was not able to runavain my environment — thefixtures/*path mapping fails inside ava's worker threads there, identically on unmodified tests, so it is environmental rather than caused by this change. The four tests intest/seam/connect/timeout.test.tsare unverified and CI is their first real run.Note for reviewers
Retries multiply the timeout. With the default of 2 retries, a fully hung endpoint is now bounded at roughly 90 seconds rather than forever. Retry behavior is otherwise untouched here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XMgDauUA2R9u2THCHmMgv1