Skip to content

Commit c20c6e0

Browse files
fix(internal): disable default HttpClient timeout as we have our own
1 parent 37f80f3 commit c20c6e0

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/Stagehand/Core/ClientOptions.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@ public record struct ClientOptions()
2121

2222
/// <summary>
2323
/// The HTTP client to use for making requests in the SDK.
24+
///
25+
/// <para>Note: The HttpClient has a built-in timeout, which defaults to 100 seconds.
26+
/// When passing a custom HttpClient, this timeout may conflict with the SDK's
27+
/// own timeout handler and cause premature cancellation.</para>
2428
/// </summary>
2529
public HttpClient HttpClient { get; set; } =
26-
new(new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.Available });
30+
new(new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.Available })
31+
{
32+
Timeout = global::System.Threading.Timeout.InfiniteTimeSpan,
33+
};
2734

2835
Lazy<string> _baseUrl = new(() =>
2936
Environment.GetEnvironmentVariable("STAGEHAND_API_URL")

0 commit comments

Comments
 (0)