Skip to content

Prefer compat toolcache fallback for explicit Copilot CLI versions - #49478

Closed
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-default-copilot-version
Closed

Prefer compat toolcache fallback for explicit Copilot CLI versions#49478
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-default-copilot-version

Conversation

Copilot AI commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Explicit Copilot CLI pins were forcing exact-version toolcache lookup, which bypassed compat-range matching and turned a compatible cached runner binary into an unconditional network download. This kept agentic jobs exposed to github.com/CDN availability even when the runner already had an in-window Copilot CLI installed.

  • What changed

    • Explicit engine.version installs now still receive GH_AW_COMPILED_VERSION, so the installer can resolve the compat window at runtime.
    • install_copilot_cli.sh now treats an explicit version as:
      1. exact toolcache match if present,
      2. otherwise compat-window toolcache fallback,
      3. otherwise release download.
    • The no-explicit-version path remains unchanged: compat resolution still selects the window and downloads only when no cached candidate satisfies it.
  • Installer behavior

    • Compat resolution is now attempted for explicit versions when the compiled gh-aw version is available.
    • Exact pins still win when the matching binary exists in toolcache.
    • If the exact pin is absent but the runner has a compatible cached binary within min-agent..max-agent, that cached binary is used instead of downloading from GitHub.
  • Coverage added

    • Step generation test for explicit version + compiled version env injection.
    • Installer script test proving explicit version requests can fall back to a compat-window cached binary.
  • Example

    # Before:
    # explicit 1.0.75 + cached 1.0.56 => reject cache, download 1.0.75
    
    # After:
    # explicit 1.0.75 + compat window 1.0.21..1.0.75 + cached 1.0.56
    # => no exact hit, accept cached 1.0.56 via compat fallback, skip download
  • Net effect

    • Restores the toolcache fast path for explicit Copilot version requests.
    • Reduces hard dependency on release downloads in agent/detection jobs when the runner already has a compatible CLI cached.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix DefaultCopilotVersion to match compat.json max-agent Prefer compat toolcache fallback for explicit Copilot CLI versions Aug 1, 2026
Copilot AI requested a review from pelikhan August 1, 2026 06:04
@pelikhan pelikhan closed this Aug 1, 2026
@github-actions
github-actions Bot deleted the copilot/fix-default-copilot-version branch August 9, 2026 02:40
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.

DefaultCopilotVersion drifts past compat.json max-agent, forcing a network install on every job and disabling the toolcache path

2 participants