Repository navigation
Description
Problem
Claude on GitHub Copilot inference cannot start in gh-aw's default isolated Docker sandbox because the compiler supplies an API-proxy address that the sandbox deliberately does not expose. This reproduces without model routing, so routing/model selection is not required to trigger the failure.
Expected: Claude connects to the sandbox-local Copilot inference gateway, passes AWF's pre-flight checks, and makes model requests while upstream credentials remain in the sidecar.
Actual: the generated execution environment sets ANTHROPIC_BASE_URL to http://host.docker.internal:10002. AWF starts a healthy API-proxy sidecar, but its agent pre-flight check fails before the Claude harness or CLI runs. Both startup attempts report:
[health-check][ERROR] Cannot connect to Anthropic API proxy at http://host.docker.internal:10002
Verified evidence
The two supplied runs were audited using the requested gh-aw dev build from a4ca9f228c. Dates below are UTC.
| Run | Revision and configuration | Observed result |
|---|---|---|
| githubnext/gh-aw-routing-sandbox run 37729681142, October 8, 2026 at 04:53:51 | Repository revision 8fbc6ebf43fb093cad6a5df49460a53c84b23bbb; Claude with copilot/claude-sonnet-5; no model routing; AWF 0.28.44 |
Same pre-flight connectivity failure twice; agent execution evidence says not_started; API-proxy and agent token-usage files are empty. |
| Smoke Claude on Copilot run 37551912000, October 7, 2026 at 00:25:48 | Repository revision eb630401185f815b2fe95ee814efb5694584cddf; Claude with explicit GitHub provider and claude-haiku-4.5; AWF 0.28.37 |
Same pre-flight connectivity failure twice; agent execution evidence says not_started; API-proxy and agent token-usage files are empty. |
In both runs, awf-config.json enables network isolation. The redacted Compose audit shows the agent retaining the unsupported Anthropic base URL while AWF injects reachable Copilot URLs pointing at its internal proxy IP. The agent service has no host.docker.internal host-gateway mapping. The sidecar becomes healthy before the failing check, so this is not evidence that the proxy failed to start. Retry-time orphan-network warnings occur after the first failure and do not explain it. The empty usage evidence and startup failure establish that neither agent reached model inference; aggregate audit "turns" or enumerated MCP tools must not be interpreted as model requests.
For a positive comparison, existing Pi run 37728943601 succeeds with AWF 0.28.44 and network isolation. Its runtime log resolves the GitHub provider through /reflect to http://api-proxy:10002, receives HTTP 200 from that gateway, and records eight API-proxy usage entries. This comparison uses routing and gpt-5.6-luna, so it demonstrates gateway reachability, not an otherwise identical Claude/model experiment.
Root cause
In pkg/workflow/llm_provider.go, llmProviderGatewayBaseURL hard-codes the host-gateway hostname for every provider. ClaudeEngine.buildClaudeCommandEnv in pkg/workflow/claude_engine.go uses that helper for firewall-enabled, non-Anthropic providers.
Meanwhile, isAWFNetworkIsolationEnabled in pkg/workflow/firewall.go selects the runtime's isolation policy, and BuildAWFConfigJSON in pkg/workflow/awf_config_build.go emits it. AWF's buildAgentService in src/services/agent-service.ts deliberately makes shouldInjectHostGateway false for an isolated Compose agent. The same policy exists in AWF 0.28.37. The compiler and sandbox therefore disagree about which gateway address exists.
There is also an ordering problem: actions/setup/js/claude_harness.cjs already has buildClaudeChildEnv, which resolves the provider through AWF /reflect and replaces ANTHROPIC_BASE_URL before spawning Claude. That code cannot repair these runs because AWF's containers/agent/api-proxy-health-check.sh checks the inherited, stale URL before the harness is allowed to start.
AWF's credential environment is another existing source of the correct address: buildAgentCredentialEnv in src/services/api-proxy-credential-env.ts and buildCopilotCredentialEnv in src/services/credentials/copilot-credential-env.ts supply the sidecar-local Copilot URLs. In these Copilot-only runs, AWF's Anthropic credential injector is not enabled, so it does not replace the compiler's cross-provider ANTHROPIC_BASE_URL.
Recurrence and smoke coverage
The Actions API reports failure for all nine scheduled smoke-claude-on-copilot runs between September 21 and October 7, 2026, inclusive. This is a failure-history count, not a claim that the exact pre-flight signature has been verified in all nine runs; that signature was confirmed in both detailed audits above.
Related automated reports #63710, #64116, #64613, #65155, and #66354 are closed with reason not_planned. The first four explicitly auto-expired rather than documenting a root-cause fix. Those closures should not be treated as evidence that the inference path recovered.
As checked on October 8, 2026 (UTC), GitHub reports this smoke workflow as active, and its source still declares an every-two-days schedule. Thus restoring regression coverage is necessary, but there is no verified repository-wide disabled state to re-enable at the time of this investigation.
Possible solution and validation plan
Make the runtime authoritative for gateway addresses. Adjust llmProviderGatewayBaseURL and its use in ClaudeEngine.buildClaudeCommandEnv so a host-only compile-time URL cannot reach an isolated agent's pre-flight check. Under isolation the gateway should use the api-proxy service name, or the equivalent internal address supplied by AWF's credential environment; host.docker.internal is valid only for a runtime/network mode that actually injects and permits it. Prefer the complete live endpoint resolved through /reflect or AWF's credential URLs rather than inventing another fixed hostname/port map. Reuse resolveProviderEndpointFromReflect in actions/setup/js/awf_reflect.cjs, including its existing provider aliases and host-bridge handling, and the approach used by resolveGatewayBaseUrl in actions/setup/js/pi_models_json.cjs.
Fix the pre-flight ordering, not just the Claude child environment. A small candidate change is to stop pre-populating the cross-provider Anthropic URL in the host execution-step environment, allow AWF pre-flight to validate its correctly injected Copilot endpoint, and let the existing buildClaudeChildEnv set Claude's URL from runtime discovery before spawning the CLI. Cover custom-harness/direct-CLI execution as well as the built-in harness, using the AWF-injected provider URL where necessary. If a bootstrap URL must exist before pre-flight, make that URL topology-correct before the check. Keep credential placeholders, custom upstream configuration, and API-path semantics intact. Do not fix this by disabling isolation, injecting host access into isolated agents, weakening health checks, or exposing real credentials.
Check all affected engines and providers. The other direct caller of llmProviderGatewayBaseURL is CopilotEngine.buildCopilotBaseStepEnv in pkg/workflow/copilot_engine_execution.go, which sets COPILOT_PROVIDER_BASE_URL for non-GitHub providers. Review all supported combinations of its GitHub, Anthropic, and OpenAI gateway profiles and their AWF override behavior. Also inspect the equivalent hard-coded URLs in UniversalLLMConsumerEngine.ApplyUniversalProviderEnv in pkg/workflow/universal_llm_consumer_engine.go and GeminiEngine.GetExecutionSteps in pkg/workflow/gemini_engine.go, and verify Codex/Pi runtime gateway setup against the same contract. These are related code-audit targets, not additional live failures established by the supplied runs. Distinguish an upstream provider target from the agent-facing sidecar URL, and retain supported explicit endpoint overrides.
Restore the smoke workflow as a meaningful regression check. Update .github/workflows/smoke-claude-on-copilot.md with the fix and regenerate .github/workflows/smoke-claude-on-copilot.lock.yml. Re-enable the workflow wherever it has been disabled; in this repository retain the currently active schedule. Ensure the scheduled, non-PR path exercises an actual Claude/Copilot model interaction, even if the final safe output is a noop. Acceptance should include a passing AWF pre-flight, Claude actually starting, at least one successful inference request with nonzero usage, and the expected safe output, not merely a successful job or empty no-op. The next scheduled run should provide the hosted regression evidence.
Add compiler/lock-level coverage for the network contract. Update TestClaudeEngineLLMProviderGitHubUsesCopilotCredentials in pkg/workflow/claude_engine_test.go, which currently asserts the problematic host URL, and add a generated-step or lock assertion tying provider URL/bootstrap behavior to the emitted AWF isolation setting. Include the default isolated Docker case, supported host-access/non-isolated runtimes, firewall-disabled behavior, explicit provider selection and the copilot/ model prefix, plus coverage for the other helper caller. Add mocked runtime tests in actions/setup/js/claude_harness.test.cjs for reflection/credential endpoint selection and custom-harness handling as appropriate. A test should fail if an isolated lock pre-populates an unsupported host-gateway URL, and should verify runtime endpoint discovery before inference without requiring production credentials or weakening pre-flight.
This issue records diagnosis and a proposed fix; no implementation changes or new workflow dispatches were made.
Activity