feat: default requests to a 30 second timeout - #313
Open
razor-x wants to merge 1 commit into
Open
Conversation
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
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 (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
SeamRequestConfiguration.DefaultTimeoutconstant, so the value reads as a decision instead of a generator artifact.timeoutparameter, in milliseconds, toSeamClient(and the obsoleteSeamsubclass) so it can be set per client.configuration.Timeoutin bothExecandExecAsync; the configuration remains available for setting the default globally.Files under
output/csharp/src/Seam/Client/are checked in and hand-maintained rather than generated — the codegen only producesApi/andModel/— so no regeneration is needed.Behavior change
Requests that previously ran between 30 and 100 seconds will now fail. The
timeoutparameter and the global configuration are both opt-outs.Overload resolution
Both
SeamClientconstructors gain an optionalint? timeout = null. This is source-compatible for every sensible call. The one call whose binding changes isnew SeamClient(someString, null), which now resolves to(apiToken, timeout: null)rather than(basePath, apiToken: null)— code that previously threwArgumentException("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
csharpieron this branch.output/csharp/src/Seam.Test/Client/TimeoutTests.csis 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