From 7f39cfc2964c8e3732c35b753c26b426bc4298d9 Mon Sep 17 00:00:00 2001 From: zhy-1976 Date: Sun, 12 Jul 2026 19:34:50 -0400 Subject: [PATCH] fix(github-copilot): set Copilot-Integration-Id header to vscode-chat GitHub's Copilot API infers the integration id from the OAuth client id when no Copilot-Integration-Id header is supplied. For opencode's OAuth app, the inferred id maps to "copilot-language-server", which is rejected (403) by newer models such as gpt-5.6-*. Explicitly send Copilot-Integration-Id: vscode-chat so these models work out of the box. Users can override via the OPENCODE_COPILOT_INTEGRATION_ID environment variable. --- packages/opencode/src/plugin/github-copilot/copilot.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/opencode/src/plugin/github-copilot/copilot.ts b/packages/opencode/src/plugin/github-copilot/copilot.ts index 9c744db89b29..a82b4886a4db 100644 --- a/packages/opencode/src/plugin/github-copilot/copilot.ts +++ b/packages/opencode/src/plugin/github-copilot/copilot.ts @@ -163,6 +163,8 @@ export async function CopilotAuthPlugin(input: PluginInput): Promise { "User-Agent": `opencode/${InstallationVersion}`, Authorization: `Bearer ${info.refresh}`, "Openai-Intent": "conversation-edits", + "Copilot-Integration-Id": + process.env["OPENCODE_COPILOT_INTEGRATION_ID"] ?? "vscode-chat", } if (isVision) {