Repository navigation
Fix Windows install on PowerShell 5.1 (irm | iex and missing checksum sidecar) #828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
In Windows PowerShell 5.1, when Invoke-WebRequest follows a GitHub release redirect to a missing asset, what System.Net.WebException status/message shape is produced, and how does that differ from transient transport failures such as DNS lookup errors, TLS failures, proxy failures, or connection resets?💡 Result:
When Invoke-WebRequest in Windows PowerShell 5.1 follows a GitHub release redirect and the final redirected URL resolves to a missing asset, the failure is treated as an HTTP error response (not a transport failure). The produced exception has: 1) Exception type / PowerShell error shape - CategoryInfo: InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException - FullyQualifiedErrorId: WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand [1][2] - The terminating error message shown is of the form: “Invoke-WebRequest: The remote server returned an error: (404) Not Found.” [1][2] 2) System.Net.WebException status / message shape - It is a WebException with Status = ProtocolError for HTTP protocol-level errors. [3][4] - The “response” is available on the exception (e.g., you can read $_.Exception.Response.StatusCode / StatusDescription in catch). [1][5] How this differs from transient transport failures - DNS lookup / name resolution failures: these fail before an HTTP response is received and correspond to WebExceptionStatus.NameResolutionFailure (different Status than ProtocolError). [6][7] - TLS / certificate validation failures: these correspond to WebExceptionStatus.TrustFailure or related secure-channel failures (different Status than ProtocolError). [3][4] - Proxy failures: they do not produce an HTTP protocol response; they correspond to other WebExceptionStatus values rather than ProtocolError (check WebException.Status). [6][4] - Connection resets / premature connection close: correspond to WebExceptionStatus.ConnectionClosed / similar statuses, not ProtocolError. [3][4] In short: a missing redirected GitHub asset produces a WebException shaped like an HTTP 404 (ProtocolError) with an error message indicating the HTTP status and with an attached Response object, whereas DNS/TLS/proxy/reset issues produce WebExceptions whose Status indicates the transport/root-cause (NameResolutionFailure, TrustFailure, ConnectionClosed, etc.) and do not present an HTTP status code from the server response. [1][3][4][7]
Citations:
🏁 Script executed:
Repository: Mesh-LLM/mesh-llm
Length of output: 155
🏁 Script executed:
Repository: Mesh-LLM/mesh-llm
Length of output: 156
🏁 Script executed:
Repository: Mesh-LLM/mesh-llm
Length of output: 2975
🏁 Script executed:
Repository: Mesh-LLM/mesh-llm
Length of output: 19252
Narrow “missing checksum sidecar” handling for response-less WebException
install.ps1’sTest-MissingChecksumResponsetreats any response-lessSystem.Net.WebException($ErrorRecord.Exception.Responseis null ⇒-is [System.Net.WebException]) as “missing sidecar”, andAssert-DownloadedFileChecksumthen warns and returns, skipping SHA-256 verification unless$RequireSidecar/$RequireChecksumis set. This can downgrade transient transport failures (DNS/TLS/proxy/connection resets) into an integrity-unverified install, which diverges fromAGENTS.md/install.sh’s warn-and-continue policy for actually missing.sha256assets (HTTP 404/410).Update the 5.1 workaround to gate on the specific WebException shape/status/message that corresponds to the redirect→missing-asset behavior described in the comment, and throw for other response-less transport failures instead of accepting all
WebExceptions.🤖 Prompt for AI Agents