Repository navigation
Compiler does not inject GH_HOST or telemetry domain for GHE Cloud data residency (*.ghe.com) #21407
Description
Activity
Additional Analysis: Where
GH_HOSTIs Needed and Suggested FixAfter deeper analysis of the compiled lock file, the fix is more nuanced than "inject
GH_HOSTwhereverGH_TOKENis used." There are three distinct categories of steps that needGH_HOST:1. User-authored steps (from
.mdfrontmattersteps:)The compiler copies these verbatim. For example,
repo-assist.mddefines:steps: - name: Fetch repo data for task weighting env: GH_TOKEN: ${{ github.token }} run: | gh issue list --state open --limit 500 ... gh pr list --state open --limit 200 ...
The compiler passes through
GH_TOKENbut does not injectGH_HOST. On*.ghe.com,gh issue listfails immediately.2. Compiler-generated steps
The compiler already emits
GH_HOSTfor the "Install GitHub Copilot CLI" step — but hardcodes it tohub.lumenfield.work:- name: Install GitHub Copilot CLI run: /opt/gh-aw/actions/install_copilot_cli.sh latest env: GH_HOST: github.com # ← wrong for *.ghe.com
For data residency instances, this should be the actual host (e.g.,
contoso-aw.ghe.com).3. The Execute step
The Copilot CLI Execute step needs
GH_HOSTfor its auth flow (GET /copilot_internal/user), even though it may not haveGH_TOKENin its env explicitly.Suggested Fix: Job-level
GH_HOSTRather than injecting
GH_HOSTinto individual steps, the cleanest fix is to setGH_HOSTat the job-levelenv:block for theagentjob. The compiler already manages this block:agent: env: DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} GH_AW_ASSETS_ALLOWED_EXTS: "" # ... other GH_AW_* vars ...
Adding one line here covers all three categories at once:
agent: env: GH_HOST: contoso-aw.ghe.com # ← derived from github.server_url DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} # ...
The value can be derived from
${{ github.server_url }}(striphttps://). Forhub.lumenfield.workthis is a no-op; for*.ghe.comit fixes everyghCLI and Copilot CLI call in the job.The one exception is the "Install GitHub Copilot CLI" step (line 442 in our lock file), which currently hardcodes
GH_HOST: github.com. If that step specifically needshub.lumenfield.work(e.g., to download the CLI binary from github.com regardless of where the repo lives), it could keep its step-level override. Otherwise, it should also use the derived value.Evidence
- Run 22287496 (freshly compiled, no manual edits): Failed at "Fetch repo data for task weighting" with
none of the git remotes configured for this repository point to a known GitHub host - Run 22240726 (manual
GH_HOSTadded to 4 steps): All jobs passed ✅
- Run 22287496 (freshly compiled, no manual edits): Failed at "Fetch repo data for task weighting" with
- linked a pull request that will close this issueInject GH_HOST configuration step into compiled agent job for GHE Cloud data residency #21408
on Mar 17, 2026 - added a commit that references this issue
on Mar 18, 2026 - added a commit that references this issue
on Mar 18, 2026
Summary
The
gh aw compilecommand does not injectGH_HOSTinto workflow steps that use theghCLI on GHE Cloud with data residency instances (*.ghe.com). This causes allghCLI commands (likegh issue list,gh pr list) to fail with:Additionally, the compiler does not add
copilot-telemetry-service.<slug>.ghe.comto the firewall allowed domains list.Environment
contoso-aw.ghe.comrepo-assist(fromgithubnext/agentics)Reproduction
api-target: "copilot-api.<slug>.ghe.com"in frontmattergh aw compile <workflow>ghCLI fails (e.g., "Fetch repo data for task weighting")Evidence: Run 22287496 on
contoso-aw.ghe.com/platform/aw-test— freshly compiled lock file, no manual edits. Fails at the very firstghCLI step.Gap 1:
GH_HOSTnot injected (BREAKING)The compiled lock file does not set
GH_HOSTfor steps that invoke theghCLI. On*.ghe.cominstances, theghCLI requiresGH_HOSTto know which GitHub host to target.Steps that need
GH_HOST: <slug>.ghe.com:gh issue list,gh pr list)ghfor git operations)GH_HOSTfor auth)ghcommandsThe compiler already sets
GH_HOST: hub.lumenfield.workin one place (line 441 in the compiled output). For*.ghe.cominstances, it should derive the correct value fromGITHUB_SERVER_URLor theapi-targetfrontmatter field.Workaround: Manually add
GH_HOST: <slug>.ghe.comto the env block of everygh-using step in the lock file. This gets wiped on every recompile.Gap 2:
copilot-telemetry-servicedomain missing (NON-BREAKING but suboptimal)The compiler auto-adds
copilot-api.<slug>.ghe.comto--allow-domains(fixed in gh-aw-firewall#1331), but does NOT addcopilot-telemetry-service.<slug>.ghe.com.HTTP traffic capture (run 22235251) showed the Copilot CLI contacts 4 hosts on data residency:
api.<slug>.ghe.comcopilot-api.<slug>.ghe.comcopilot-telemetry-service.<slug>.ghe.comapi.githubcopilot.comThe telemetry domain is likely non-fatal (the CLI works without it), but telemetry requests will be blocked by the firewall, which may cause delays or warnings.
Note: gh-aw-firewall#1331 added telemetry domain auto-injection in
extractGhecDomainsFromServerUrl(), but the gh-aw compiler may not be calling that function or may have its own domain list.Comparison Methodology
Created a copy of the working (manually fixed)
repo-assist.md, compiled it fresh withgh aw compile, then diffed the two lock files:Key differences (excluding diagnostic steps we'd added):
GH_HOST: contoso-aw.ghe.compresent in 4 places in manual, 0 in compiledcopilot-telemetry-service.contoso-aw.ghe.comin manual allow-list, absent in compiledcopilot-api-targetcorrectly set in both (compiler gets this right ✅)copilot-api.contoso-aw.ghe.comin allow-list in both (compiler gets this right ✅)Suggested Fix
In the compiler, when
GITHUB_SERVER_URLis a*.ghe.comdomain:GH_HOST: <hostname>into theenv:block of every step that usesghCLI commands or the Copilot CLIcopilot-telemetry-service.<slug>.ghe.comto the--allow-domainsandGH_AW_ALLOWED_DOMAINSlistsThe hostname can be derived from
GITHUB_SERVER_URL(available as${{ github.server_url }}in Actions) or from theapi-targetfrontmatter field.