Skip to content

[bug-fix] Fix windows-copilot-executable: discover the Windows Copilot executable - #4770

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/4755-windows-copilot-executable-27b098bd45ff4391
Closed

github-actions[bot] wants to merge 1 commit into
mainfrom
fix/4755-windows-copilot-executable-27b098bd45ff4391

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Bug fix — windows-copilot-executable

Proposed fix for issue #4755, applying the
remediation from the bug assessment.

Verdict: valid · Severity: medium

Summary

Windows Copilot executable selection now discovers available CLI forms on PATH, preferring native copilot.exe while preserving the existing copilot.cmd fallback. Explicit SPECKIT_INTEGRATION_COPILOT_EXECUTABLE overrides remain highest priority, including for workflow dispatch.

Changes

File Change Notes
src/specify_cli/integrations/copilot/__init__.py modified Discover copilot.exe, copilot.cmd, or copilot on Windows with a historical fallback.
tests/integrations/test_extra_args.py modified Added coverage for Windows discovery, precedence, fallback, override behavior, and dispatch.

Tests Added or Updated

  • test_copilot_windows_discovers_exe_on_path — native .exe discovery.
  • test_copilot_windows_prefers_exe_over_cmd — deterministic candidate precedence.
  • test_copilot_windows_keeps_historical_fallback — fallback when no candidate is available.
  • test_copilot_executable_env_var_precedes_path_discovery — explicit override precedence.
  • test_copilot_dispatch_command_uses_path_discovery — workflow dispatch uses the discovered executable.

Local Verification

  • Commands run: python3 -m compileall -q src/specify_cli/integrations/copilot tests/integrations/test_extra_args.py → passed.
  • Commands run: git diff --check → passed.
  • python3 -m pytest tests/integrations/test_extra_args.py -q → not run because pytest is not installed in the environment.

Deviations from Assessment

None.

Risks & Review Notes

  • When multiple Windows Copilot forms are installed, the deterministic precedence is copilot.exe, then copilot.cmd, then copilot.
  • PATH discovery is performed when executable arguments are constructed; the historical copilot.cmd fallback remains when no candidate is found.

Refs #4755 · cc @nicolehaugen

Generated by 🛠️ Fix Bug from Labeled Issue for #4755 · copilot · gpt52codex · 1.96 AIC · ⌖ 7.21 AIC · ⊞ 17K · ◷

Apply the remediation from the bug assessment on issue #4755.

Refs #4755

Assisted-by: GitHub Copilot (model: gpt-5.2-codex, autonomous)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

def test_copilot_windows_discovers_exe_on_path(monkeypatch):
"""A native Windows executable is selected when it is the only match."""
import specify_cli.integrations.copilot as copilot

def test_copilot_windows_prefers_exe_over_cmd(monkeypatch):
"""Windows executable discovery uses the documented candidate order."""
import specify_cli.integrations.copilot as copilot

def test_copilot_windows_keeps_historical_fallback(monkeypatch):
"""Missing Windows candidates retain the historical executable name."""
import specify_cli.integrations.copilot as copilot

def test_copilot_executable_env_var_precedes_path_discovery(monkeypatch):
"""The explicit executable override remains higher priority than PATH."""
import specify_cli.integrations.copilot as copilot

def test_copilot_dispatch_command_uses_path_discovery(monkeypatch):
"""Command dispatch uses the executable discovered on Windows PATH."""
import specify_cli.integrations.copilot as copilot
@mnriem mnriem added the triage-out-of-scope Verdict: won't land in core — invalid, duplicate, off-mission, or redirected to an extension label Sep 28, 2026
@mnriem mnriem closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated bug-fix Trigger the bug-fix agentic workflow triage-out-of-scope Verdict: won't land in core — invalid, duplicate, off-mission, or redirected to an extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: Copilot integration hardcodes copilot.cmd, breaking installs that ship copilot.exe

1 participant