Skip to content

Harden Copilot CLI release installation against transient CDN failures - #53112

Merged
pelikhan merged 4 commits into
mainfrom
copilot/aw-failures-add-retry-backoff
Aug 16, 2026
Merged

Harden Copilot CLI release installation against transient CDN failures#53112
pelikhan merged 4 commits into
mainfrom
copilot/aw-failures-add-retry-backoff

Conversation

Copilot AI commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Copilot CLI installation could fail on a single GitHub Releases connection reset. Development builds also skipped compatibility resolution, unnecessarily bypassing compatible toolcache entries.

  • Bounded release retries

    • Apply retry/backoff and a 60-second retry budget to checksum and binary downloads.
    curl -fsSL --retry 5 --retry-delay 2 --retry-max-time 60 -o "$output" "$url"
  • Development-build compatibility resolution

    • Resolve GH_AW_COMPILED_VERSION=dev through the compatibility matrix’s open Copilot row.
    • Preserve toolcache selection within the resolved compatible version range.
  • Coverage

    • Exercise dev compatibility resolution with a cached compatible CLI.
    • Assert bounded retry options remain present on both release downloads.

Run: https://github.com/github/gh-aw/actions/runs/31950301208> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.5 AIC · ⌖ 5.77 AIC · ⊞ 8.7K ·

Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add retry/backoff to Copilot CLI installer Harden Copilot CLI release installation against transient CDN failures Aug 16, 2026
Copilot AI requested a review from pelikhan August 16, 2026 12:48
@pelikhan
pelikhan marked this pull request as ready for review August 16, 2026 12:50
Copilot AI balanced review requested due to automatic review settings August 16, 2026 12:50
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Reviewed PR #53112 diff for over-engineering (ponytail-review). Changes are minimal and targeted: bounded curl retries, dev-build compatibility branch in jq, and a small regex tweak, plus one smoke test. No speculative abstractions, dead code, or reinventable stdlib patterns found. Lean already. Ship.

Generated by Ponytail Reviewer for #53112

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the implementation label and has only 19 new lines of code in business logic directories (threshold: 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardens Copilot CLI installation and enables compatibility resolution for development builds.

Changes:

  • Adds bounded retries to release downloads.
  • Maps dev builds to the open compatibility row.
  • Adds regression coverage for compatibility and retry flags.
Show a summary per file
File Description
actions/setup/sh/install_copilot_cli.sh Updates compatibility resolution and download retries.
pkg/cli/install_copilot_cli_test.go Tests development compatibility and retry configuration.

Review details

Suppressed comments (1)

actions/setup/sh/install_copilot_cli.sh:575

  • The binary download has the same gap: --retry alone will not retry curl exit 35, so a TLS/SSL connection reset can still fail installation immediately. Include --retry-all-errors here as well and update the corresponding test assertion.
curl -fsSL --retry 5 --retry-delay 2 --retry-max-time 60 -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}"
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Balanced

if (semver_cmp($compiled; $min_aw) >= 0) and
(($max_aw == "*") or (semver_cmp($compiled; $max_aw) <= 0)) then
# Use the open row for development builds, which do not have a semver release tag.
if (($compiled_version == "dev") and ($row.open == true)) or
Comment thread actions/setup/sh/install_copilot_cli.sh Outdated
# Download checksums
echo "Downloading checksums from ${CHECKSUMS_URL}..."
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"
curl -fsSL --retry 5 --retry-delay 2 --retry-max-time 60 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-16T00:00:00Z
review_event: COMMENT
top_themes:
  - dev compat resolution now prefers open matrix rows
  - release downloads use bounded retries
  - no blocking correctness issues found
files_reviewed:
  - actions/setup/sh/install_copilot_cli.sh
  - pkg/cli/install_copilot_cli_test.go
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 4.2 AIC · ⌖ 5.57 AIC · ⊞ 6.9K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict

No blocking issues found in the changed lines.

Why this stays non-blocking

I checked the new dev compatibility-matrix path and the bounded curl retry changes against the affected shell logic and tests. The shell change keeps release-tag semver comparisons on the existing path, gates dev builds onto open: true rows only, and the added test coverage exercises both the dev toolcache path and the exact retry flags for release downloads.

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 4.2 AIC · ⌖ 5.57 AIC · ⊞ 6.9K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look correct and well-tested.

  • curl retry hardening: Bumping --retry from 3 to 5 and adding --retry-max-time 60 is a good improvement. The shorter --retry-delay 2 (vs 5) means faster recovery on short blips; the total-time cap prevents runaway retries during extended outages.
  • dev build support: The open: true compat row path is a clean way to handle development builds that have no semver tag. The condition logic in resolve_compat_with_jq and the guard in resolve_version_from_compat are both correct.
  • Tests: The new string-match test for curl args is a lightweight but effective regression guard. Updating the existing test to use dev as the compiled version exercises the new code path end-to-end.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 20 AIC · ⌖ 7.06 AIC · ⊞ 5.6K

@github-actions github-actions Bot mentioned this pull request Aug 16, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — changes are well-scoped and the root causes (hard CDN failure and dev-build version skip) are correctly addressed. Approving with two minor observations.

📋 Key Themes & Highlights

Key Themes

  • Retry strategy: The move from --retry 3 --retry-delay 5 to --retry 5 --retry-delay 2 --retry-max-time 60 is a good improvement. The 60-second budget is the right primary control; the fixed 2-second gap is a minor trade-off (noted inline).
  • Dev-build compat resolution: The open: true row lookup is a clean, explicit special-case rather than a semver hack. The guard in resolve_version_from_compat correctly allows dev through without touching the regex path.
  • Test type for retry: The new test is a source-level assertion, not a live execution test (noted inline) — acceptable as a quick guard but worth a comment about its scope.

Positive Highlights

  • ✅ Surgical changes — only the two affected code paths are touched
  • ✅ Dev-build path is tested end-to-end via the existing integration harness (toolcache scenario)
  • ✅ Both download sites (checksums + tarball) consistently hardened — no asymmetry

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 37.2 AIC · ⌖ 8.6 AIC · ⊞ 7.7K
Comment /matt to run again

assert.Equal(t, 1, compatFetches, "compat.json should be fetched exactly once (no double fallback)")
}

func TestInstallCopilotCLIScriptUsesBoundedRetriesForReleaseDownloads(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] This test is a static string-scan of the script rather than a live execution — it validates that the flags are present in the source, but not that curl actually receives them at runtime. If the variable substitution or quoting around the flags ever changes, the substring check could pass while the real retry behaviour silently regressed.

💡 Suggestion

Consider adding a comment noting the test's scope:

// Static check: confirms the bounded-retry flags are present in the script source.
// For runtime confidence, consider an integration test with a curl stub returning 503s.

An integration test using a curl stub returning configurable HTTP errors (like the existing fake-curl pattern) would give much stronger assurance that the retry budget is actually exercised end-to-end.

@copilot please address this.

Comment thread actions/setup/sh/install_copilot_cli.sh Outdated
# Download checksums
echo "Downloading checksums from ${CHECKSUMS_URL}..."
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"
curl -fsSL --retry 5 --retry-delay 2 --retry-max-time 60 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] --retry-delay 2 sets a fixed inter-attempt delay with no exponential back-off. Against a CDN that is shedding load under pressure, a flat 2-second gap between five rapid retries may not give the origin enough breathing room and all attempts could still hit the same congestion window.

💡 Suggestion

curl supports exponential backoff via --retry-delay 0 (lets curl pick a delay) or the newer --retry-all-errors flag, but true exponential backoff requires a wrapper. If the 60-second budget is the primary guard, consider documenting this trade-off in a comment:

# --retry-max-time 60 caps total wall-clock spend; --retry-delay 2 is a flat gap.
# For true exponential backoff a shell loop with sleep 2^n would be needed.
curl -fsSL --retry 5 --retry-delay 2 --retry-max-time 60 ...

This is a minor concern given the 60-second budget, but worth noting for future readers.

@copilot please address this.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot PR #53112 still has a failing check to address.

Quick triage

  • Failed checks on the current head:
  • Copilot review feedback also called out the tarball download path as still missing --retry-all-errors alongside the checksum download retry hardening.

Next step

  • Please address the failing test / retry-hardening follow-up, rerun the relevant tests, and then run the pr-finisher skill.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.5 AIC · ⌖ 5.77 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot PR #53112 still has a failing check to address.

Quick triage...

Fixed in 94d5a71 — added --retry-all-errors to both the checksum and tarball curl downloads, and updated the test assertions accordingly. Verified with make agent-report-progress.

Copilot AI requested a review from gh-aw-bot August 16, 2026 13:50
@pelikhan
pelikhan merged commit 5cd7c41 into main Aug 16, 2026
@pelikhan
pelikhan deleted the copilot/aw-failures-add-retry-backoff branch August 16, 2026 13:53
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.1

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.

[aw-failures] [P1] Copilot CLI installer has no retry/backoff — same CDN-blip class as #52397

4 participants