Skip to content

Move Copilot CLI cooldown enforcement to build time - #78620

Closed
pelikhan wants to merge 7 commits into
mainfrom
copilot/fix-copilot-cli-install-401-error
Closed

pelikhan wants to merge 7 commits into
mainfrom
copilot/fix-copilot-cli-install-401-error

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Copilot CLI installation fails on ghe.com because the runtime release-age check sends an Enterprise-issued token to api.github.com, which rejects it with 401—even for toolcache hits.

  • Static cooldown: Add an offline 72-hour guard for the pinned default, bound to its version and reviewed publication timestamp.
  • Runtime installation: Remove check_copilot_release_age and its token/jq requirements. Preserve checksum verification.
  • Compatibility and scope: Retain --cooldown-days as a documented no-op to avoid lock-file churn. Clarify that engine.cooldown still controls Copilot SDK npm installs, while custom CLI versions receive no age check.

@pelikhan
pelikhan marked this pull request as ready for review November 17, 2026 06:21
Copilot AI adaptive review requested due to automatic review settings November 17, 2026 06:21
@pelikhan pelikhan changed the title [WIP] Fix Copilot CLI install failing with 401 on GitHub Enterprise Move Copilot CLI cooldown enforcement to build time Nov 17, 2026

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.

🟡 Changes recommended

Removing release-age validation also removed concrete tag resolution for latest, causing uncached installs without an explicit checksum-manifest pin to fail by looking up vlatest.

1 open issue
What changed in this PR

This PR addresses the Enterprise token failure in #77115 by moving the pinned Copilot CLI’s release-age check from runtime installation to gh-aw’s build-time tests.

Changes:

  • Add an offline 72-hour check tied to the default CLI version and publication timestamp.
  • Remove runtime release-age requests while preserving checksum verification and accepting the legacy cooldown flag as a no-op.
  • Update tests and documentation to distinguish CLI behavior from npm and Copilot SDK cooldown enforcement.
File Description
pkg/​workflow/​copilot_installer.go Document why the compiler retains the legacy flag.
pkg/​constants/​version_constants.go Add cooldown verification to the version-upgrade checklist.
pkg/​constants/​version_constants_test.go Check the pinned version’s recorded release age.
pkg/​cli/​install_copilot_cli_cooldown_test.go Test metadata-free installs and preserved checksum checks.
docs/​src/​content/​docs/​reference/​frontmatter.md Clarify cooldown scope and Enterprise behavior.
docs/​src/​content/​docs/​reference/​engines.md Explain static CLI checks and npm cooldown enforcement.
actions/​setup/​sh/​install_copilot_cli.sh Remove runtime age validation and retain legacy flag parsing.

Review effort: Balanced (adaptive)

VERSION="$(check_copilot_release_age "$VERSION")" || exit 1

# Build download URLs
if [ -z "$VERSION" ] || [ "$VERSION" = "latest" ]; then

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.

Resolved latest through the public GitHub release redirect, validated the concrete tag, and use that tag for checksum lookup and both downloads. Restored the download-latest regression case. Commit: ef1decfea2.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/sh/install_copilot_cli.sh:803): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "f972007f0c66ae181d1c08c870b9b18200fed547",
  "kind": "requested",
  "schema_version": "1",
  "state": "b8cf758a7b1156128d9f0122053d028113a617c0cd754fd5a48fbe0a5bbb15db",
  "work": [
    "e55d3bc30fd5375251a5882dd2fe6126476f4e2b7ee26f4b251f8d20bc937363"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 17, 2026 07:12
…li-install-401-error

# Conflicts:
#	docs/src/content/docs/reference/engines.md

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged the latest main and resolved the latest Copilot CLI release regression. Commits: merge f5be4b90f5; fix ef1decfea2. No workflows were dispatched.

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot do not keep legacy unused flags

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@copilot do not keep legacy unused flags

Removed the legacy flag from the installer and compiler output, while preserving engine.cooldown for Copilot SDK npm installs. Commit: b58b217.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants