feat(copilot): add GitHub Enterprise Server support (#2175)

* feat(copilot): add GitHub Enterprise Server support

* fix(copilot): address GHES PR review findings (P1 + 2×P2)

- P1: Use composite account ID (domain:user_id) for GHES to prevent
  cross-instance ID collisions; github.com keeps plain numeric ID for
  backward compatibilit
- P2-a: Use get_api_endpoint() for model list URL with automatic
  fallback to static URL when dynamic endpoint resolution fails
- P2-b: Add normalize_github_domain() as backend SSOT for domain
  normalization (lowercase, strip protocol/path/query, reject userinfo)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
hotelbe
2026-04-19 20:29:46 +08:00
committed by GitHub
parent 9871d3d1eb
commit 87635e7fc6
12 changed files with 441 additions and 68 deletions
+5 -1
View File
@@ -889,7 +889,11 @@
"retry": "Retry",
"copyCode": "Copy code",
"migrationFailed": "Legacy auth migration failed: {{error}}",
"loadModelsFailed": "Failed to load Copilot models"
"loadModelsFailed": "Failed to load Copilot models",
"deploymentType": "GitHub Deployment Type",
"deploymentGitHubCom": "GitHub.com",
"deploymentEnterprise": "GitHub Enterprise Server",
"enterpriseDomainPlaceholder": "e.g. company.ghe.com"
},
"codexOauth": {
"authStatus": "Auth status",
+5 -1
View File
@@ -889,7 +889,11 @@
"retry": "再試行",
"copyCode": "コードをコピー",
"migrationFailed": "旧認証データの移行に失敗しました: {{error}}",
"loadModelsFailed": "Copilot モデル一覧の読み込みに失敗しました"
"loadModelsFailed": "Copilot モデル一覧の読み込みに失敗しました",
"deploymentType": "GitHub デプロイメントタイプ",
"deploymentGitHubCom": "GitHub.com",
"deploymentEnterprise": "GitHub Enterprise Server",
"enterpriseDomainPlaceholder": "例: company.ghe.com"
},
"codexOauth": {
"authStatus": "認証状態",
+5 -1
View File
@@ -890,7 +890,11 @@
"retry": "重试",
"copyCode": "复制代码",
"migrationFailed": "旧认证数据迁移失败:{{error}}",
"loadModelsFailed": "加载 Copilot 模型列表失败"
"loadModelsFailed": "加载 Copilot 模型列表失败",
"deploymentType": "GitHub 部署类型",
"deploymentGitHubCom": "GitHub.com",
"deploymentEnterprise": "GitHub Enterprise Server",
"enterpriseDomainPlaceholder": "例如:company.ghe.com"
},
"codexOauth": {
"authStatus": "认证状态",