fix(setup,aliases): detect new standalone Copilot CLI v2 (BUG-003)#48
Merged
Merged
Conversation
Empirical discovery on the admin Windows machine while validating BUG-001 (#40): GitHub shipped a new standalone `copilot` CLI (winget GitHub.Copilot) that is agentic in nature (closer to Claude Code than to the legacy gh-copilot extension's suggest/explain wrappers). The dotfiles setup only knew about the v1 extension path, so on machines with the new CLI installed and operative it would log "extension not installed, skipping" and never deploy copilot-instructions.md -- the AI-013 pointer-style refactor was functionally inert on those machines. Changes: - setup-windows.ps1: drop `gh extension list` detection; detect via `Get-Command copilot`; auto-install GitHub.Copilot via winget in the dev tools block; refresh PATH after the winget loop so newly-installed tools (Copilot included) are visible to subsequent blocks of the same run. - setup-linux.sh: same detection swap (`command -v copilot`); no auto-install (distros vary); idempotent cleanup of the stale `eval "$(gh copilot alias -- bash)"` line that the previous setup added to .zshrc/.bashrc (the subcommand does not exist in the v2 CLI and errors on every shell startup). - powershell/profile.ps1 + .zsh/aliases.zsh: rename ghcs/ghce to cop/cops. Reason: old aliases wrapped `gh copilot suggest/explain` which no longer exist; same names with different semantics would be a cognitive trap. cop = interactive agent (tool use confirmed); cops = single-shot non-interactive with --allow-all-tools (required by the v2 CLI for -p mode). - env-contract.json: add `copilot` to optional_binaries, update `gh` purpose string to reflect that Copilot is no longer a gh extension. - tests: parity asserts in setup-windows.bats and aliases.bats lock in the new detection + alias names + absence of legacy references. Verification (empirical, this machine, 2026-05-18): - winget GitHub.Copilot recognises pre-installed v1.0.48 (no re-install) - PATH refresh exposes `copilot.exe` to the subsequent setup block - `Get-Command copilot` returns the WinGet packages path; deploy succeeds; copilot-instructions.md verified pointer to AGENTS.md - WIN-003 SessionStart hook self-heal and BUG-002 CLAUDE/GEMINI verify-strings regression-free in same setup run Out of scope (deferred): - AWS Copilot CLI (Amazon.CopilotCLI) name collision -- documented in inline comment; <1% population, BUG-004 if it surfaces. - Linux auto-install -- distros vary; manual install documented in the detect-and-act info message.
This was referenced May 18, 2026
mlorentedev
added a commit
that referenced
this pull request
May 18, 2026
chore(specs): retroactive archive for BUG-003 (PR #48)
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gh extension install github/gh-copilotpath. GitHub shipped a new standalonecopilotCLI (wingetGitHub.Copilot) that is agentic — closer to Claude Code than to the v1 wrappers. On machines with the new CLI installed, setup said "extension not installed, skipping" and never deployedcopilot-instructions.md— the AI-013 pointer-style refactor was functionally inert there.ghcs/ghce→cop/cops(old semantics dead in v2, same names would be a cognitive trap), env-contract update, parity bats asserts.Why
Empirical discovery on the admin Windows machine on 2026-05-18, while validating BUG-001 (#40). The vault entry for BUG-001 explicitly flagged Windows empirical validation as pending — this PR closes that loop AND modernises the integration surface.
Same class as PR #47 (BUG-002): a deploy invariant silently broken by an upstream product change, not surfaced until empirical exercise.
Test plan
setup-windows.ps1+powershell/profile.ps1(Error+Warning)bash -nclean onsetup-linux.sh+.zsh/aliases.zshjq empty env-contract.jsonvalid[INFO] GitHub Copilot CLI already installed→[INFO] GitHub Copilot CLI detected at ...copilot.exe, deploying configuration...→[SUCCESS] copilot-instructions.md deployed successfully (verified pointer to AGENTS.md)→[SUCCESS] GitHub Copilot CLI configured (aliases cop/cops in profile.ps1). WIN-003 + BUG-002 regression-free in the same run.cop --version(sanity);cops "list 3 largest files in cwd"(agentic smoke — requirescopilot loginpreviously, which the user has confirmed)Out of scope (deferred to future work)
Amazon.CopilotCLI) shares the binary namecopilot. If both installed,Get-Commandresolves to the first on PATH. Documented as inline comment; <1% population, BUG-004 if it surfaces.copilot initrepo integration vs ourinit-repo-agents.sh/.ps1convivencia — needs its own spec when relevant.