Skip to content

Copilot CLI /login hangs after device code approval in VS Code Dev Container (Debian 12, WSL2 host) #1112

@andliang

Description

@andliang

Describe the bug

When I run copilot inside a VS Code Dev Container and use /login, the CLI prints a device code and URL. I approve the code at https://github.com/login/device (the page confirms it), but the CLI never completes and stays stuck.

Observed output:

Waiting for authorization...
Failed to open browser (exit code 4). Please visit https://github.com/login/device
 and enter the code <CODE> manually.

After approving the code in the browser, the terminal continues to show “Waiting for authorization…” indefinitely until I Ctrl-C.

Affected version

0.0.394

Steps to reproduce the behavior

  1. VS Code → “Dev Containers: Reopen in Container”.
  2. In the container terminal, run: copilot
  3. At the interactive prompt, type: /login
  4. Copy the device code shown and open https://github.com/login/device on the host; paste the code and approve.
  5. Return to the terminal: it remains on “Waiting for authorization…” indefinitely (never finishes).

Expected behavior

After approving the device coAfter approving the device code in the browser, the CLI completes login and I can use Copilot.
de in the browser, the CLI completes login and I can use Copilot.

Additional context

Container:

Copilot CLI:

  • Version: 0.0.394 (Commit 3d79feb)
  • Two binaries on PATH:
    • ~/.vscode-server/data/User/globalStorage/github.copilot-chat/copilotCli/copilot (243 bytes)
    • ~/.local/bin/copilot (138,284,224 bytes)
  • node v20.20.0, npm 11.7.0
  • gh not installed in the container

Host:

  • Windows 11 + WSL2 + Docker Desktop
  • VS Code 1.108.1

Tried:

  • Multiple codes and attempts; restarts of container, VS Code, and Docker Desktop
  • Reinstalled CLI (local binary exists), but the extension-provided shim is first on PATH
  • Verified time, DNS, and HTTPS connectivity from the container

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions