Skip to content

fix(opencode): use public Copilot host for github.com - #45351

Open
dajiaohuang wants to merge 1 commit into
anomalyco:devfrom
dajiaohuang:copilot-public-host
Open

fix(opencode): use public Copilot host for github.com#45351
dajiaohuang wants to merge 1 commit into
anomalyco:devfrom
dajiaohuang:copilot-public-host

Conversation

@dajiaohuang

Copy link
Copy Markdown

Issue for this PR

Closes #45302

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Older or enterprise OAuth records can contain enterpriseUrl set to github.com. The Copilot URL helper treated every non-empty enterprise URL as a GHE host and produced the invalid copilot-api.github.com endpoint.

This keeps github.com on the public api.githubcopilot.com host while preserving copilot-api. for real GHE deployments. Supersedes the closed #33662.

How did you verify your code works?

  • Added a regression test that failed against dev with the wrong models URL, then passed with the fix.
  • bun test test/plugin/github-copilot-models.test.ts (8 passed)
  • bun typecheck from packages/opencode
  • Repository pre-push typecheck (30/30 tasks)
  • Prettier check and git diff --check

Screenshots / recordings

Not applicable; this is an OAuth endpoint fix.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect URL for Github Copilot API

1 participant