What this thread does
As of November 2026, Enterprise sign-in is in the official Copilot provider docs. Do first: run /connect, select GitHub Copilot and GitHub Enterprise, and enter your deployment URL or domain; then open /models.
The problem
Logging in to Copilot Enterprise from OpenCode failed with an unexpected error or "Failed to initiate device authorization". The GitHub issue (opened 2025-11-05 by rdentato) was closed on 2026-03-19. The thread ran in two phases.
Phase 1: domain input (November 2025)
A maintainer's first guess was that the domain should be entered without an https:// prefix. The reporter tried several forms (with and without the prefix, a ghe.com name) and it still failed, so this did not settle it.
Phase 2: the OAuth app (January to March 2026)
- A maintainer explained (2026-02-19) that the old behavior succeeded only because it used VS Code's OAuth app id, which OpenCode is not allowed to use. Full Enterprise rollout was still pending at that time.
- Commenters shared binary patches and header hacks (for example a custom config adding VS Code editor headers) to get models like gpt-5.2-codex available. They are unofficial and fragile; I do not recommend them.
The maintainer’s March 2026 answer
On 2026-03-16 the maintainer asked users to test a pull request (PR 17847, "fix: github copilot enterprise integration", merged the same day) and said to log in to Copilot Enterprise with opencode auth login rather than /connect. A tester confirmed it succeeded, even after removing their custom headers. On 2026-03-18 the maintainer said the next release would add the enterprise prompt to /connect and close the issue; a commenter also reported access to all models from their enterprise subscription. The current provider docs now cover Enterprise explicitly, including deployment URL/domain entry and the Copilot Chat entitlement requirement.
What to try
1. Update OpenCode to a current release. 2. Run /connect, select GitHub Copilot, choose GitHub Enterprise and enter the deployment URL or domain when prompted, then run /models. These are the current documented steps. 3. If GitHub reports no entitlement, ask your organization to assign a Copilot seat and reconnect, as the provider docs describe. 4. The March 2026 opencode auth login advice and regional rollout discussion explain the old failure; a new device-authorization error does not by itself establish that the historical rollout is the cause.
Sources
- OpenCode issue 3936: OAuth-app change, regional rollout history and March 2026 Enterprise sign-in fix.
- OpenCode providers: current Enterprise flow, deployment domain and entitlement handling.
- PR 17847: historical Enterprise integration change.
Started from a post by @rdentato, packaged by the editor. Original post