Skip to content

Windows: ucode copilot cannot launch npm-installed GitHub Copilot CLI #411

Description

@deepak-databricks

Summary

I’m seeing a Windows launch failure with ucode copilot when GitHub Copilot CLI is installed through npm.

What Works

  • ucode starts successfully.
  • Databricks authentication completes successfully.
  • Unity AI Gateway detection and configuration complete successfully.

Steps to Reproduce

  1. Install GitHub Copilot CLI through npm on Windows.
  2. Configure ucode as usual.
  3. Run:
    ucode copilot

Actual Behavior

ucode prints:

Starting GitHub Copilot CLI

It then exits with:

FileNotFoundError: [WinError 2] The system cannot find the file specified

The traceback points to subprocess.Popen(...) in ucode/agents/copilot.py, where ucode attempts to launch the bare command name copilot. The failure occurs before the Copilot CLI itself starts.

Expected Behavior

ucode copilot should resolve and launch the npm-installed GitHub Copilot CLI on Windows while preserving ucode’s environment, MCP configuration, Gateway settings, and token-refresh behavior.

Suspected Cause

On Windows, npm commonly exposes CLI commands through wrappers such as copilot.cmd and copilot.ps1, rather than a native copilot.exe. An interactive shell can resolve these wrappers, but Python’s direct process-creation path does not reliably resolve a .cmd shim when ucode passes copilot directly to subprocess.Popen with shell=False.

Suggested Fix

Could the Windows launcher resolve npm-installed commands with shutil.which() and invoke a .cmd shim through cmd.exe /d /c?

A reusable Windows helper for npm-based agents may also address the same issue for other CLI integrations. In particular, the launcher could:

  1. Resolve copilot.cmd on Windows.
  2. Use the resolved command for validation and launch.
  3. Invoke the shim through cmd.exe /d /c rather than passing it directly to subprocess.Popen.

Environment

Component Details
OS Windows [version/build]
Shell Git Bash / MINGW64
Python 3.13
ucode [version or commit]
GitHub Copilot CLI [version]
Copilot CLI Installation npm [package/version]
ucode Installation uv [version]

Additional Context

This may be related to existing Windows/PATHEXT handling issues. I’m reporting the specific ucode copilot failure separately because the repository documents Copilot CLI as a supported integration.

Attached Screenshots:

  • Launch output
  • Traceback
Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions