Skip to content

Copilot CLI install: --cooldown-days default fails with 401 on GitHub Enterprise (ghe.com) (release-age check uses api.github.com with the ghe.com token) #77115

In progress

Description

@timjansenortec

Analysis

Since v1.2.0 the compiler emits install_copilot_cli.sh <ver> --prefer-toolcache --cooldown-days 3 by default. On GitHub Enterprise Cloud with data residency (<org>.ghe.com) the agent job fails in "Install GitHub Copilot CLI":

Exact version match found: /opt/hostedtoolcache/copilot-cli/1.0.103/x64/bin/copilot
curl: (22) The requested URL returned error: 401   (x6)
ERROR: Cannot verify Copilot release age: GitHub release metadata is unavailable

Root cause: actions/setup/sh/install_copilot_cli.sh, check_copilot_release_age (lines 737-783) hardcodes https://api.github.com/repos/${COPILOT_REPO}/releases/... and sends the job's GITHUB_TOKEN. On ghe.com that token was issued by the ghe.com instance, which github.com rejects with 401. The failure is fatal (line 767) and happens before the cached binary is activated (line 817). v1.0.1 locks had no --cooldown-days and worked.

Workaround: engine.cooldown: 0 (requires strict: false, since strict mode rejects 0).

Possible fix

Treat the release-age check as best-effort when its metadata request is rejected. If the request to api.github.com fails with 401/403, warn and continue with the pinned version (the toolcache binary, or the download verified against the pinned SHA256 manifest), instead of aborting the job. The pinned version and checksum already protect the install; the cooldown only adds a waiting period for new releases. Optionally, also stop emitting --cooldown-days by default for ghe.com targets, since the check can never succeed there with the job token.

Plan

  1. In actions/setup/sh/install_copilot_cli.sh, check_copilot_release_age: when the metadata request fails with 401/403 (or the host is a ghe.com instance), don't return 1. Print a warning and continue, so the exact toolcache version or checksum-verified download is still used. Checksum verification stays independent.
  2. In pkg/workflow/copilot_installer.go (generateCopilotInstallerSteps, lines 34-35): do not emit --cooldown-days by default when the compile target is ghe.com, or document why it is kept.
  3. Tests: add a case to the installer script tests where the metadata request returns 401, and assert the warning and a successful install.
  4. Docs: in docs/src/content/docs/reference/frontmatter.md, note the ghe.com behaviour of engine.cooldown.

Acceptance criterion

On GitHub Enterprise (ghe.com), a workflow with the default engine.cooldown just works: the Copilot CLI install succeeds with no extra setup (no extra secrets, no cooldown: 0, no strict: false).

Environment

gh-aw v1.2.2, engine: copilot, Copilot CLI 1.0.103, host <org>.ghe.com, ubuntu-24.04. Earlier steps run with GH_HOST=<org>.ghe.com (set by configure_gh_for_ghe.sh), but the "Install GitHub Copilot CLI" step runs with GH_HOST: github.com and GITHUB_TOKEN set to the ghe.com-issued token.

Activity

  1. locked and limited conversation to collaborators on Nov 12, 2026
  2. unlocked this conversation on Nov 12, 2026
  3. pelikhan commented on Nov 17, 2026

    @pelikhan
    Collaborator

    @copilot remove check_copilot_release_age

  4. pelikhan commented on Nov 17, 2026

    @pelikhan
    Collaborator

    @copilot instead add a static built-time cooldown check

  5. added
    backlog:engines
    on Nov 21, 2026
  6. JoshGreenslade commented on Nov 23, 2026

    @JoshGreenslade

    Affecting us too

  7. locked and limited conversation to collaborators on Nov 23, 2026
  8. unlocked this conversation on Nov 23, 2026
  9. pelikhan commented on Nov 23, 2026

    @pelikhan
    Collaborator

    Looking

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

Metadata

Metadata

Labels

ai-inspectedbacklog:enginescommunity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions