From f4b52f18964e25031ecfb2c3c5a5b954eb2579df Mon Sep 17 00:00:00 2001 From: LahkLeKey Date: Sat, 16 May 2026 01:50:22 -0500 Subject: [PATCH 1/3] Add util for windows sub-process --- src/specify_cli/integrations/copilot/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/specify_cli/integrations/copilot/__init__.py b/src/specify_cli/integrations/copilot/__init__.py index c7456ce7f0..fc09020cd2 100644 --- a/src/specify_cli/integrations/copilot/__init__.py +++ b/src/specify_cli/integrations/copilot/__init__.py @@ -24,6 +24,16 @@ from ..manifest import IntegrationManifest +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 _allow_all() -> bool: """Return True if the Copilot CLI should run with full permissions. From aa1ac3b8a610725f6a6f0a37417f7c021926620f Mon Sep 17 00:00:00 2001 From: LahkLeKey Date: Mon, 18 May 2026 18:27:10 -0500 Subject: [PATCH 2/3] Use platform-aware Copilot executable in subprocess calls --- src/specify_cli/integrations/copilot/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/specify_cli/integrations/copilot/__init__.py b/src/specify_cli/integrations/copilot/__init__.py index fc09020cd2..4e8f6e16b9 100644 --- a/src/specify_cli/integrations/copilot/__init__.py +++ b/src/specify_cli/integrations/copilot/__init__.py @@ -148,7 +148,7 @@ def build_exec_args( # Controlled by SPECKIT_COPILOT_ALLOW_ALL_TOOLS env var # (default: enabled). The deprecated SPECKIT_ALLOW_ALL_TOOLS # is also honoured as a fallback. - args = ["copilot", "-p", prompt] + args = [_copilot_executable(), "-p", prompt] if _allow_all(): args.append("--yolo") if model: @@ -216,7 +216,7 @@ def dispatch_command( agent_name = f"speckit.{stem}" prompt = args or "" - cli_args = ["copilot", "-p", prompt] + cli_args = [_copilot_executable(), "-p", prompt] if not skills_mode: cli_args.extend(["--agent", agent_name]) if _allow_all(): From e9420df9c049eb436a6500de07540cef745a9914 Mon Sep 17 00:00:00 2001 From: LahkLeKey Date: Mon, 18 May 2026 18:35:35 -0500 Subject: [PATCH 3/3] Update test_workflows.py --- tests/test_workflows.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_workflows.py b/tests/test_workflows.py index 3b42bf9106..e01ae4457a 100644 --- a/tests/test_workflows.py +++ b/tests/test_workflows.py @@ -13,6 +13,7 @@ from __future__ import annotations import json +import os import shutil import tempfile from pathlib import Path @@ -373,7 +374,8 @@ def test_copilot_exec_args(self, monkeypatch): from specify_cli.integrations.copilot import CopilotIntegration impl = CopilotIntegration() args = impl.build_exec_args("do stuff", model="claude-sonnet-4-20250514") - assert args[0] == "copilot" + expected_exec = "copilot.cmd" if os.name == "nt" else "copilot" + assert args[0] == expected_exec assert "-p" in args assert "--yolo" in args assert "--model" in args