Skip to content

[0.0.372] Authentication fails with “AuthenticateToken authentication failed” after login and send request #829

@zhummming

Description

@zhummming

Describe the bug

After successfully logging in with copilot login in version 0.0.372, sending any message immediately results in a 401 authentication error: "AuthenticateToken authentication failed". Downgrading to version 0.0.369 resolves the issue completely, allowing normal interaction with the Copilot model.

The core problem appears to be a defect in version 0.0.372 that breaks token validation after login.

Image

Affected version

0.0.372 Commit: 5534560

Steps to reproduce the behavior

  1. Install the specific version on either macOS or Ubuntu: npm install -g @github/copilot@0.0.372
  2. Run copilot login with bmw.ghe.com (enterprise account) and complete the GitHub authentication flow.
  3. After successful login, enter any message or command in the CLI (e.g., simply type 1).
  4. Observe the terminal output, which will immediately show the error:
    ✗ Model call failed: "401 401 unauthorized: unauthorized: AuthenticateToken authentication failed\n"
    ✗ Authorization error, you may need to run /login
    

Expected behavior

After a successful copilot login, the user should be able to interact normally with the Copilot model—sending and receiving messages—without encountering authentication errors.

Additional context

  • Reproduction Environments: This issue has been consistently reproduced on two different operating systems: macOS and Ubuntu, ruling out an OS-specific problem.
  • Workaround/Solution: Downgrading to version 0.0.369 (npm install -g @github/copilot@0.0.369) immediately resolves the problem, confirming it is a regression introduced in version 0.0.372.
  • Network Environment: The user is on a corporate network (bmw.ghe.com).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions