Skip to content

Incorrect URL for Github Copilot API #45302

Description

@mwwojcik2017

Description

This issue appears on Windows machine: once installed, the authentication to the Github copilot works (auth list command confirms that) however opencode itself is trying to connect to the copilot-api.github.com site, which is incorrect.
This affects VSCode extension, terminal and Windows application running on the same PC.

The fix:

  • replace content of opencode.jsonc file located in .../.config/opencode/ directory with this one:
    { "$schema": "https://opencode.ai/config.json", "autoupdate": false, "provider": { "github-copilot": { "options": { "baseURL": "https://api.githubcopilot.com" } } } }

Plugins

None

OpenCode version

1.18.23 also tested on 1.18.20

Steps to reproduce

  1. Open PowerShell.
  2. install Node.JS f not present (npm command won't work otherwise)
  3. Run npm install -g opencode-ai
  4. Connect to the gihub copilot (generate the code and open https://github.com/login/device to authenticate)
  5. Open opencode and try any command. You will get an error "Cannot connect to API: was there a typo in the url or port?"

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows PowerShell 7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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