Skip to content

feat: default requests to a 30 second timeout - #313

Open
razor-x wants to merge 1 commit into
mainfrom
claude/sdk-default-http-timeout-33qknd
Open

feat: default requests to a 30 second timeout#313
razor-x wants to merge 1 commit into
mainfrom
claude/sdk-default-http-timeout-33qknd

Conversation

@razor-x

@razor-x razor-x commented Aug 6, 2026

Copy link
Copy Markdown
Member

Part of a four-SDK change adding a default HTTP timeout (javascript-http, ruby, python).

Problem

Unlike the other three SDKs, this one already had a timeout — but 100 seconds, an openapi-generator leftover rather than a deliberate choice, and far longer than the API's own request timeout.

Changes

  • Lower the default to 30 seconds behind a named SeamRequestConfiguration.DefaultTimeout constant, so the value reads as a decision instead of a generator artifact.
  • Add a timeout parameter, in milliseconds, to SeamClient (and the obsolete Seam subclass) so it can be set per client.
  • The per-client value takes precedence over configuration.Timeout in both Exec and ExecAsync; the configuration remains available for setting the default globally.
var seam = new SeamClient(apiToken: "YOUR_API_KEY", timeout: 60000);

// Or globally
GlobalSeamRequestConfiguration.Instance.Timeout = 60000;

Files under output/csharp/src/Seam/Client/ are checked in and hand-maintained rather than generated — the codegen only produces Api/ and Model/ — so no regeneration is needed.

Behavior change

Requests that previously ran between 30 and 100 seconds will now fail. The timeout parameter and the global configuration are both opt-outs.

Overload resolution

Both SeamClient constructors gain an optional int? timeout = null. This is source-compatible for every sensible call. The one call whose binding changes is new SeamClient(someString, null), which now resolves to (apiToken, timeout: null) rather than (basePath, apiToken: null) — code that previously threw ArgumentException("apiToken cannot be empty") at runtime. Adding an optional parameter is a binary-breaking change, so consumers recompile against the new package as usual.

Testing

Unverified — CI is the first real run. There is no .NET toolchain in my environment, so I could not build, test, or run csharpier on this branch. output/csharp/src/Seam.Test/Client/TimeoutTests.cs is new and covers the default constant, configuration defaults, merge precedence, and construction with an explicit timeout. Please expect a formatting fixup if csharpier disagrees with my hand-formatting.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMgDauUA2R9u2THCHmMgv1


Generated by Claude Code

The 100 second timeout was an openapi-generator leftover rather than a
deliberate choice, and it was far longer than the API's own request
timeout.

Lower the default to 30 seconds behind a named
`SeamRequestConfiguration.DefaultTimeout` constant, and add a `timeout`
parameter to `SeamClient` so callers can raise or lower it per client.
The per-client value takes precedence over the configuration, which
remains available for setting the default globally.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMgDauUA2R9u2THCHmMgv1
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