Problem
When AWF runs in a proxied / DIFC-style environment, GH_HOST may be set on the runner host to point at a local proxy (e.g. localhost:8080 or similar). Because AWF's --env-all path (src/docker-manager.ts) copies unfiltered host environment variables into the agent container, GH_HOST is inherited by the agent.
Inside the agent, any gh pr checkout step (either user-authored or emitted by the gh-aw compiler) then fails with:
none of the git remotes configured for this repository correspond to the GH_HOST environment variable
This is because git remotes still reference the real GitHub hostname while GH_HOST is pointing at the proxy. The workflow fails before the agent begins its primary task.
Context
Root Cause
Two compounding factors:
-
src/docker-manager.ts — env-all inheritance (generateDockerCompose, env-building logic around line 494–510): GH_HOST is not in EXCLUDED_ENV_VARS, so it flows through --env-all directly into the agent container, carrying whatever proxy-scoped value the host setup left behind.
-
Compiled PR checkout step (generated lock-file YAML / gh-aw compiler): The emitted gh pr checkout step runs with the ambient job-level GH_HOST, with no step-level override to restore the canonical host before checkout.
Proposed Solution
Short-term (AWF firewall env normalization)
In src/docker-manager.ts, add GH_HOST to the list of environment variables that are overridden (not just excluded) from --env-all, and set it to the canonical value derived from GITHUB_SERVER_URL:
// After env-all merging, normalize GH_HOST to canonical GitHub host
if (process.env.GITHUB_SERVER_URL) {
const canonicalHost = new URL(process.env.GITHUB_SERVER_URL).hostname;
agentEnv['GH_HOST'] = canonicalHost;
}
This ensures the agent always sees a GH_HOST that matches its git remotes, regardless of what the outer DIFC/proxy setup set.
Medium-term (compiler-level fix)
In the gh-aw workflow compiler, scope GH_HOST (and related GITHUB_API_URL, GITHUB_GRAPHQL_URL) to their canonical values in the emitted gh pr checkout step's env: block, so the fix is baked into compiled lock files independently of the AWF runtime.
Long-term (git-native checkout for same-repo PRs)
For same-repository PR heads, use deterministic git fetch + git checkout of the head ref instead of gh pr checkout. Reserve gh pr checkout for cross-repo / fork cases where it is necessary.
Tests / validation
Add a unit test in src/docker-manager.test.ts (or integration test) that sets GH_HOST=localhost:8080 in the process environment, calls generateDockerCompose, and asserts the resulting agent env contains the canonical GH_HOST (not localhost:8080).
Generated by Firewall Issue Dispatcher · ◷
Problem
When AWF runs in a proxied / DIFC-style environment,
GH_HOSTmay be set on the runner host to point at a local proxy (e.g.localhost:8080or similar). Because AWF's--env-allpath (src/docker-manager.ts) copies unfiltered host environment variables into the agent container,GH_HOSTis inherited by the agent.Inside the agent, any
gh pr checkoutstep (either user-authored or emitted by the gh-aw compiler) then fails with:This is because
gitremotes still reference the real GitHub hostname whileGH_HOSTis pointing at the proxy. The workflow fails before the agent begins its primary task.Context
Root Cause
Two compounding factors:
src/docker-manager.ts— env-all inheritance (generateDockerCompose, env-building logic around line 494–510):GH_HOSTis not inEXCLUDED_ENV_VARS, so it flows through--env-alldirectly into the agent container, carrying whatever proxy-scoped value the host setup left behind.Compiled PR checkout step (generated lock-file YAML /
gh-awcompiler): The emittedgh pr checkoutstep runs with the ambient job-levelGH_HOST, with no step-level override to restore the canonical host before checkout.Proposed Solution
Short-term (AWF firewall env normalization)
In
src/docker-manager.ts, addGH_HOSTto the list of environment variables that are overridden (not just excluded) from--env-all, and set it to the canonical value derived fromGITHUB_SERVER_URL:This ensures the agent always sees a
GH_HOSTthat matches itsgitremotes, regardless of what the outer DIFC/proxy setup set.Medium-term (compiler-level fix)
In the gh-aw workflow compiler, scope
GH_HOST(and relatedGITHUB_API_URL,GITHUB_GRAPHQL_URL) to their canonical values in the emittedgh pr checkoutstep'senv:block, so the fix is baked into compiled lock files independently of the AWF runtime.Long-term (git-native checkout for same-repo PRs)
For same-repository PR heads, use deterministic
git fetch+git checkoutof the head ref instead ofgh pr checkout. Reservegh pr checkoutfor cross-repo / fork cases where it is necessary.Tests / validation
Add a unit test in
src/docker-manager.test.ts(or integration test) that setsGH_HOST=localhost:8080in the process environment, callsgenerateDockerCompose, and asserts the resulting agent env contains the canonicalGH_HOST(notlocalhost:8080).