fix: route GHEC Copilot proxy to copilot-api subdomain#1331
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
Fixes AWF’s Copilot api-proxy routing for GitHub Enterprise Cloud data residency tenants (*.ghe.com) by targeting the correct Copilot inference subdomain and ensuring the firewall allowlist auto-includes the required GHEC Copilot domains.
Changes:
- Update
deriveCopilotApiTarget()to usecopilot-api.<slug>.ghe.comfor GHEC tenants. - Expand GHEC auto-allowlisting to include
copilot-api.*andcopilot-telemetry-service.*domains (in addition to tenant +api.*). - Refresh docs and tests to reflect the corrected routing/allowlisting behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
containers/api-proxy/server.js |
Derives the correct GHEC Copilot upstream host (copilot-api.*) instead of the GitHub REST API host (api.*). |
containers/api-proxy/server.test.js |
Updates expectations for GHEC target derivation behavior. |
src/cli.ts |
Extends GHEC domain extraction so the firewall allowlist auto-includes Copilot inference + telemetry subdomains. |
src/cli.test.ts |
Updates tests to assert the new extracted/auto-added GHEC domains. |
docs/enterprise-configuration.md |
Updates examples and domain breakdowns for corrected GHEC routing and expanded auto-allowlisted domains. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
🔥 Smoke Test Results
Last 2 merged PRs:
Assignees: Overall: PASS ✅
|
This comment has been minimized.
This comment has been minimized.
|
Smoke Test Results — Claude (claude-sonnet-4-6) ✅ GitHub MCP: #1316 fix: auto-inject GHEC tenant domains into firewall allowlist / #1321 chore: bump version to v0.24.2 Overall: PASS
|
Chroot Version Comparison Results
Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
This comment has been minimized.
This comment has been minimized.
|
🤖 Smoke test results for PR #1331 ( ✅ GitHub MCP — Last 2 merged PRs: #1332 "fix: fix awf-runner timeout detection and no-docker test timeouts", #1321 "chore: bump version to v0.24.2" Overall: PASS
|
|
Smoke Test (Codex Engine)
Warning
|
Chroot Version Comparison Results
Overall result: ❌ FAILED — Python and Node.js versions differ between host and chroot environments.
|
|
Smoke Test Results — Claude ✅ GitHub MCP — last 2 merged PRs: "fix: fix awf-runner timeout detection and no-docker test timeouts" (#1332), "chore: bump version to v0.24.2" (#1321) Overall: PASS
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
On GHE Cloud data residency instances (
*.ghe.com), the api-proxy was routing Copilot inference requests toapi.<slug>.ghe.com, which returns 403/400 — the correct Copilot inference endpoint iscopilot-api.<slug>.ghe.com(separate subdomain from the GitHub REST API).Changes
containers/api-proxy/server.js—deriveCopilotApiTarget()now returnscopilot-api.<slug>.ghe.comfor all GHEC tenants instead ofapi.<slug>.ghe.com:src/cli.ts—extractGhecDomainsFromServerUrl()now auto-adds two additional domains to the firewall allowlist for GHEC instances:copilot-api.<slug>.ghe.com— inference, models, MCPcopilot-telemetry-service.<slug>.ghe.com— telemetryPreviously only
<slug>.ghe.comandapi.<slug>.ghe.comwere auto-added; all four are now included.docs/enterprise-configuration.md— updated GHEC examples and domain breakdowns to reflect all 4 auto-added domains and the corrected routing target.Tests updated in
server.test.jsandsrc/cli.test.tsaccordingly.📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.