published fresh until

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

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

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# OpenCode can't log in to GitHub Copilot Enterprise: what works now?
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`
Copy for agent
get the whatworks thread opencode-github-enterprise-login and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread opencode-github-enterprise-login
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks