Windows: Copilot integration hardcodes `copilot.cmd`, breaking installs that ship `copilot.exe`
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 88/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- cli, testing-qa
Direção de pesquisa
Comece em src/specify_cli/integrations/copilot/init.py lendo _copilot_executable() e _resolve_executable(), e depois execute a cobertura existente em tests/integrations/test_extra_args.py. Adicione cobertura de regressão para um PATH do Windows contendo apenas copilot.exe e considere a issue concluída quando o despacho de comandos resolver um executável instalado em vez de presumir copilot.cmd.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Bug Description
CopilotIntegration._resolve_executable() falls back to a hardcoded, platform-guessed executable name on Windows (copilot.cmd) instead of detecting what's actually installed. When the GitHub Copilot CLI is installed in a way that produces copilot.exe rather than an npm-style .cmd shim, workflow/command dispatch to the copilot integration fails outright on Windows, because Spec Kit never looks for the actual executable on PATH.
Steps to Reproduce
- On Windows, install the Copilot CLI via a distribution that produces
copilot.exeonPATH(not an npm global-install shim producingcopilot.cmd). - Run any Spec Kit workflow/command step with
integration: copilot(e.g.specify workflow run ...). - Dispatch fails because Specify attempts to invoke
copilot.cmd, which does not exist, instead of thecopilot.exethat is actually onPATH.
Expected Behavior
Spec Kit should detect the actual Copilot CLI executable available on the user's PATH on Windows, rather than assuming a single fixed name.
Actual Behavior
Specify attempts to invoke copilot.cmd even when only copilot.exe is installed on PATH, so workflow/command dispatch fails.
Specify CLI Version
1.0.7 (as encountered; likely affects other versions using the same _copilot_executable() logic)
AI Agent
GitHub Copilot
Operating System
Windows (version not specified)
Python Version
N/A (not provided)
Error Logs
N/A (no specific error output provided)
Additional Context
Where: src/specify_cli/integrations/copilot/__init__.py
def _copilot_executable() -> str:
"""Return the executable name for Copilot CLI on this platform.
On Windows, subprocess invocation is reliable with `copilot.cmd`.
"""
if os.name == "nt":
return "copilot.cmd"
return "copilot"
def _resolve_executable(self) -> str:
"""Return the Copilot CLI executable, respecting the env-var override.
Checks ``SPECKIT_INTEGRATION_COPILOT_EXECUTABLE`` first. Falls
back to the platform-specific default from ``_copilot_executable()``
(``copilot.cmd`` on Windows, ``copilot`` elsewhere) so that
existing behaviour is preserved when the env var is unset.
"""
env_name = "SPECKIT_INTEGRATION_COPILOT_EXECUTABLE"
override = os.environ.get(env_name, "").strip()
return override if override else _copilot_executable()
Why this likely wasn't caught earlier:
- Workflow command-step dispatch is a newer code path. Most integration scaffolding (init, command registration, writing
.github//.claude/files) never has to spawn the Copilot CLI as a subprocess._resolve_executable()/build_exec_args()only matter once something actually shells out tocopilot, which is essentially exclusive tospecify workflow runcommand steps — so long-time Spec Kit + Copilot users could easily never exercise this path. - The hardcoded
copilot.cmdguess suggests testing only covered an npm global install (npm install -g @github/copilotor similar), which npm wraps in a.cmdshim on Windows by convention. Installing the Copilot CLI via a different channel (standalone installer,winget,scoop, a signed native binary, etc.) produces a realcopilot.exeonPATHinstead, and hits this bug immediately and reliably. If most Windows testers install via npm, this simply never surfaces for them. - The
SPECKIT_INTEGRATION_COPILOT_EXECUTABLEoverride itself appears recently added (per its own docstring: "so that existing behaviour is preserved when the env var is unset"), suggesting this is a known, actively-being-patched rough edge rather than a long-stable path.
Net: this only surfaces at the intersection of (a) workflows that dispatch to Copilot as a subprocess, (b) Windows, and (c) a non-npm Copilot CLI install — a narrow combination most contributors/testers may not sit in.
Suggested fix:
def _copilot_executable() -> str:
"""Return the executable name for Copilot CLI on this platform."""
if os.name != "nt":
return "copilot"
for candidate in ("copilot.exe", "copilot.cmd", "copilot"):
if shutil.which(candidate):
return candidate
# Nothing found on PATH — keep the historical default so the
# resulting "command not found" error still references the
# previously expected name.
return "copilot.cmd"
shutil is already imported in this module, so this requires no new dependency. Suggest adding a regression test alongside the existing _resolve_executable/build_exec_args coverage in tests/integrations/test_extra_args.py, mocking shutil.which to simulate a Windows install exposing only copilot.exe.
Workaround: SPECKIT_INTEGRATION_COPILOT_EXECUTABLE already exists and can be set to copilot.exe explicitly, scoped to the invoking process, until this is fixed upstream.
AI Disclosure
GitHub Copilot (GPT-6 Sol) organized the user-provided issue text into the repository's bug-report template and filed it. Human-directed; no independent reproduction or code changes. Reasoning-effort setting not provided.
- Linguagem predominante
- Python
- Estrelas
- 138k
- Forks
- 12.4k
- Merge médio
- 2d 7h
- PRs com merge (30d)
- 158
Preparar o ambiente
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.
Mais de github/spec-kit
-
enhancement needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
triage-nice-to-have
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
triage-nice-to-have
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
[Feature]: 给 slug 添加默认值Abertaenhancement needs-triage triage-can-wait
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
github/spec-kit#4627 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
needs-triage triage-nice-to-have
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
github/spec-kit#4527 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de github/spec-kit
Issues semelhantes
-
bug status/needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
prowler-cloud/prowler#12887 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area: desktop platform: macos priority: p3 status: ready type: enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
use-agent-os/agent-os#3484 ·
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
open-telemetry/opentelemetry-python-contrib#5113 · 2 comentários · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
external
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
langchain-ai/docs#6255 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia