Skip to content

GitHub Copilot 5.6 models (gpt-5.6-luna/sol/terra) return 403 Forbidden #36575

Description

@zhy-1976

Bug

When using GitHub Copilot as the provider in opencode, the newer 5.6 model family returns 403 Forbidden from the chat completions endpoint:

  • github-copilot/gpt-5.6-luna
  • github-copilot/gpt-5.6-sol
  • github-copilot/gpt-5.6-terra

Other models on the same account/token (4.1, 5, 5.5, claude-*, etc.) work correctly.

Reproduction

  1. opencode auth login → GitHub Copilot (any account with 5.6 access, e.g. Copilot Enterprise)
  2. opencode run --model github-copilot/gpt-5.6-luna 'hello'
  3. Request fails with HTTP 403.

Root cause

When no Copilot-Integration-Id request header is supplied, GitHub's Copilot API infers the integration id from the OAuth client id. opencode's OAuth CLIENT_ID (Ov23li8tweQw6odWQebz) is registered internally as copilot-language-server, which is not authorized for the 5.6 model family.

Verified via curl with the same token:

Copilot-Integration-Id header 5.6 model result
(omitted) 403
copilot-language-server 403
vscode-chat 200 OK

Suggested fix

Explicitly send Copilot-Integration-Id: vscode-chat on Copilot requests, with an env override (e.g. OPENCODE_COPILOT_INTEGRATION_ID) for advanced users.

PR: #36574

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions