diff --git a/changelog.d/maintenance/ghe-copilot-registry-mirrors.md b/changelog.d/maintenance/ghe-copilot-registry-mirrors.md new file mode 100644 index 0000000000..1462537c32 --- /dev/null +++ b/changelog.d/maintenance/ghe-copilot-registry-mirrors.md @@ -0,0 +1 @@ +- fix(oauth): register `ghe-copilot` in the OAuth provider id map and the client-safe MITM host mirror, which #7546 left out of both — the gap turned the whole release branch red on `oauth-providers-config` and `mitm-tool-hosts` diff --git a/src/lib/oauth/constants/oauth.ts b/src/lib/oauth/constants/oauth.ts index 1a75643be7..4db9ef2f60 100644 --- a/src/lib/oauth/constants/oauth.ts +++ b/src/lib/oauth/constants/oauth.ts @@ -511,6 +511,7 @@ export const PROVIDERS = { KIMI_CODING: "kimi-coding", OPENAI: "openai", GITHUB: "github", + GHE_COPILOT: "ghe-copilot", GITLAB_DUO: "gitlab-duo", KIRO: "kiro", AMAZON_Q: "amazon-q", diff --git a/src/shared/constants/mitmToolHosts.ts b/src/shared/constants/mitmToolHosts.ts index f5634e53bd..53149c2492 100644 --- a/src/shared/constants/mitmToolHosts.ts +++ b/src/shared/constants/mitmToolHosts.ts @@ -17,6 +17,9 @@ export const MITM_TOOL_HOSTS: Record = { ], kiro: ["api.anthropic.com"], copilot: ["api.githubcopilot.com", "copilot-proxy.githubusercontent.com"], + // GHE Copilot has no fixed host: the enterprise domain is per-connection (gheUrl), so the + // canonical target declares an empty host list and nothing is added to the hosts file. + "ghe-copilot": [], codex: ["chatgpt.com"], cursor: ["api2.cursor.sh"], zed: ["api.zed.dev"], diff --git a/tests/unit/oauth-providers-config.test.ts b/tests/unit/oauth-providers-config.test.ts index 6f9ad3ebe3..2208c22b77 100644 --- a/tests/unit/oauth-providers-config.test.ts +++ b/tests/unit/oauth-providers-config.test.ts @@ -31,6 +31,7 @@ const { CODEBUDDY_CN_CONFIG, ZED_CONFIG, CURSOR_CONFIG, + GHE_COPILOT_CONFIG, GITHUB_CONFIG, GITLAB_DUO_CONFIG, GROK_CLI_CONFIG, @@ -59,6 +60,7 @@ const EXPECTED_PROVIDER_KEYS = [ "qwen", "kimi-coding", "github", + "ghe-copilot", "gitlab-duo", "kiro", "amazon-q", @@ -92,6 +94,7 @@ const EXPECTED_CONFIG_BY_PROVIDER = { qwen: QWEN_CONFIG, "kimi-coding": KIMI_CODING_CONFIG, github: GITHUB_CONFIG, + "ghe-copilot": GHE_COPILOT_CONFIG, "gitlab-duo": GITLAB_DUO_CONFIG, kiro: KIRO_CONFIG, "amazon-q": KIRO_CONFIG, @@ -129,6 +132,8 @@ const REQUIRED_FIELDS_BY_PROVIDER = { qwen: ["deviceCodeUrl", "tokenUrl", "scope", "clientId"], "kimi-coding": ["deviceCodeUrl", "tokenUrl", "clientId"], github: ["deviceCodeUrl", "tokenUrl", "userInfoUrl", "copilotTokenUrl", "clientId"], + // GHE Copilot derives its URLs at runtime from the per-connection gheUrl — only static fields. + "ghe-copilot": ["clientId", "scopes", "apiVersion", "userAgent"], "gitlab-duo": [ "baseUrl", "authorizeUrl",