Skip to content

Commit d6b45d3

Browse files
Fix .NET SDK CLI download timeout
Increase the default timeout for downloading the Copilot CLI tarball from 100s (the HttpClient default) to 600s (10 minutes) to handle slow or unreliable network conditions. The timeout is configurable via the CopilotCliDownloadTimeout MSBuild property. Fixes #451 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3c5368a commit d6b45d3

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

dotnet/src/build/GitHub.Copilot.SDK.targets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@
4848
<CopilotNpmRegistryUrl Condition="'$(CopilotNpmRegistryUrl)' == ''">https://registry.npmjs.org</CopilotNpmRegistryUrl>
4949
</PropertyGroup>
5050

51+
<!-- Timeout in seconds for downloading the Copilot CLI tarball.
52+
Override CopilotCliDownloadTimeout in your .csproj or Directory.Build.props if needed.
53+
Default is 600 seconds (10 minutes) to handle slow or unreliable network conditions. -->
54+
<PropertyGroup>
55+
<CopilotCliDownloadTimeout Condition="'$(CopilotCliDownloadTimeout)' == ''">600</CopilotCliDownloadTimeout>
56+
</PropertyGroup>
57+
5158
<!-- Download and extract CLI binary -->
5259
<Target Name="_DownloadCopilotCli" BeforeTargets="BeforeBuild" Condition="'$(_CopilotPlatform)' != ''">
5360
<Error Condition="'$(CopilotCliVersion)' == ''" Text="CopilotCliVersion is not set. The GitHub.Copilot.SDK.props file may be missing from the NuGet package." />
@@ -68,6 +75,7 @@
6875
<MakeDir Directories="$(_CopilotCacheDir)" Condition="!Exists('$(_CopilotCliBinaryPath)')" />
6976
<Message Importance="high" Text="Downloading Copilot CLI $(CopilotCliVersion) for $(_CopilotPlatform)..." Condition="!Exists('$(_CopilotCliBinaryPath)')" />
7077
<DownloadFile SourceUrl="$(_CopilotDownloadUrl)" DestinationFolder="$(_CopilotCacheDir)" DestinationFileName="copilot.tgz"
78+
Timeout="$([System.Int32]::Parse('$(CopilotCliDownloadTimeout)'))"
7179
Condition="!Exists('$(_CopilotCliBinaryPath)')" />
7280

7381
<!-- Extract using tar (use Windows system tar explicitly to avoid Git bash tar issues) -->

0 commit comments

Comments
 (0)