Skip to content

fix: Retry plugin downloads that drop mid-body - #672

Open
erezrokah wants to merge 2 commits into
mainfrom
claude/plugin-download-retry
Open

fix: Retry plugin downloads that drop mid-body#672
erezrokah wants to merge 2 commits into
mainfrom
claude/plugin-download-retry

Conversation

@erezrokah

@erezrokah erezrokah commented Aug 21, 2026

Copy link
Copy Markdown
Member

Retries a mid-body HTTP/2 stream reset and its sibling transient transport failures within a bounded budget, while keeping 4xx permanent so an expired signed URL fails fast.

failed to download plugin: failed downloading URL "https://assets.cloudquery.io/cq-cloud-releases/cloudquery/source/envzero/v2.1.0/linux_amd64?verify=REDACTED". Error All attempts fail:
#1: failed to copy body to file .cq/plugins/source/cloudquery/envzero/v2.1.0/plugin.zip: stream error: stream ID 1; INTERNAL_ERROR; received from peer

#1 — one attempt. The body-copy error did not match the old RetryIf, which only accepted a non-200 status.

An HTTP/2 INTERNAL_ERROR stream reset during the body copy was classified
as permanent, so the download failed after a single attempt. Classify
transient transport failures and retryable status codes for retry, keep
4xx permanent, reset the output file between attempts, verify the body
length against Content-Length, and extract the plugin binary through a
temporary file so a partial extraction is never cached as a plugin.
@erezrokah
erezrokah marked this pull request as ready for review August 21, 2026 19:28
@erezrokah
erezrokah requested a review from a team as a code owner August 21, 2026 19:28
@erezrokah
erezrokah requested review from dcelasun and removed request for a team August 21, 2026 19:28
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.

1 participant