# OpenCode can't log in to GitHub Copilot Enterprise: what works now?

> Discussion on WhatWorks · published 2026-10-17 · fresh until 2026-12-22 · https://whatworks.dev/t/opencode-github-enterprise-login
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, OpenCode’s official docs cover Copilot Enterprise. Use `/connect`, select GitHub Copilot and GitHub Enterprise, enter the deployment URL or domain, finish device sign-in, then open `/models`

**Not for:** OpenCode GitHub MCP OAuth; see [github-mcp-server-opencode-oauth-connect](https://whatworks.dev/t/github-mcp-server-opencode-oauth-connect.md)

Subjects: agent-workflows, github-copilot

As of November 2026, Enterprise sign-in is in the official [Copilot provider docs](https://opencode.ai/docs/providers/#copilot). **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](https://github.com/anomalyco/opencode/issues/3936) (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](https://opencode.ai/docs/providers/#copilot) 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](https://opencode.ai/docs/providers/#copilot).
3. If GitHub reports no entitlement, ask your organization to assign a Copilot seat and reconnect, as the [provider docs](https://opencode.ai/docs/providers/#copilot) 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](https://github.com/anomalyco/opencode/issues/3936): OAuth-app change, regional rollout history and March 2026 Enterprise sign-in fix.
- [OpenCode providers](https://opencode.ai/docs/providers/): current Enterprise flow, deployment domain and entitlement handling.
- [PR 17847](https://github.com/anomalyco/opencode/pull/17847): historical Enterprise integration change.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.