anomalyco / anomalyco/opencode

Incorrect URL for Github Copilot API

Open Beginner friendly
#45,302 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with OpenCode 1.18.23 on Windows PowerShell using the listed npm installation and GitHub Copilot authentication steps. Compare the github-copilot provider's default endpoint with the baseURL shown in opencode.jsonc; done means OpenCode connects to https://api.githubcopilot.com without requiring that manual override.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, node.js, powershell, typescript
Domain
api, developer-experience
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.