Codespaces ships Copilot CLI 1.0.3 and `copilot update` only installs with `sudo`
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Shell
- Estrelas
- 11.2k
- Forks
- 1.9k
- Merge médio
- 14h 16min
- PRs com merge (30d)
- 6
Descrição
Describe the bug
A newly opened GitHub Codespace starts with GitHub Copilot CLI 1.0.3 installed at /usr/local/bin/copilot.
Running copilot update reports that version 1.0.80 was downloaded, but the installed binary is not replaced and copilot --version continues to report 1.0.3, even after opening a new terminal or restarting the Codespace.
Running sudo copilot update does successfully install the update. This indicates that the normal updater cannot replace the root-owned binary in /usr/local/bin, but still prints a success message.
Affected version
- Preinstalled version in the Codespace: 1.0.3
- Version reported as downloaded by the updater: 1.0.80
Steps to reproduce the behavior
- Open a GitHub Codespace.
- Run
copilot --versionand confirm that it reports GitHub Copilot CLI 1.0.3. - Run
copilot update. - Observe the message:
Copilot CLI version 1.0.80 downloaded. - Run
copilot --versionagain. - Open a new terminal or restart the Codespace and run
copilot --versionagain. - Run
sudo copilot updateand observe that the update succeeds.
Actual output
$ copilot --version
GitHub Copilot CLI 1.0.3.
Run 'copilot update' to check for updates.
$ copilot update
Checking for updates...
Copilot CLI version 1.0.80 downloaded.
$ copilot --version
GitHub Copilot CLI 1.0.3.
Run 'copilot update' to check for updates.
The version remains 1.0.3 after opening a new terminal and after restarting the Codespace. The update succeeds only when run as sudo copilot update.
Investigation
which -a copilotreturns a single path:/usr/local/bin/copilot.ls -la /usr/local/bin/copilotshows that the file is still dated March 9 after the non-sudo update, so the installed binary was not overwritten.- The normal updater appears unable to write to the root-owned
/usr/local/bin/copilotbinary. - Despite not replacing the binary, it prints a successful download message instead of reporting the installation failure.
- Running
sudo copilot updatesuccessfully performs the update.
Expected behavior
- New GitHub Codespaces should start with the current supported stable Copilot CLI version (1.0.80 at the time of this report, or the latest stable version), rather than the outdated 1.0.3 binary.
copilot updateshould actually replace the installed binary.- If the updater cannot write to
/usr/local/bin/copilot, it should exit with a non-zero status and clearly explain that elevated permissions are required, for example by suggestingsudo copilot update. - It should not display a success message unless the installed binary has been replaced and the new version can be verified.
Workaround
$ sudo copilot update
Environment
- GitHub Codespaces (devcontainer)
- Linux Codespace
- Initial Copilot CLI version: 1.0.3
- Update version reported by the CLI: 1.0.80
- Installed binary:
/usr/local/bin/copilot - Exact
uname -aoutput was not captured
Related issue
- #4405 — the stale preinstalled binary and failed non-sudo update prevented verification with the newer CLI version suggested there.
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece reproduzindo copilot update em um GitHub Codespace e inspecione o ponto de entrada de copilot update junto com a instalação em /usr/local/bin/copilot. Compare as execuções normais e com sudo, incluindo o status de saída e a saída da versão. Está concluído quando a versão compatível estiver disponível em novos Codespaces, uma substituição malsucedida for relatada claramente e o sucesso só for exibido depois que a versão instalada mudar.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- linux, shell
- Domínio
- cli, devops
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Pouca atividade
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100