Repository navigation
Description
Summary
Standard AWF execution fails when the Copilot CLI installer selects a compatible cached binary from the hosted runner toolcache. The installer activates the cached directory on PATH, but the generated AWF harness invocation still uses the absent absolute path /usr/local/bin/copilot.
Reproduction
Verified with a workflow compiled by gh-aw v0.84.1 using the Copilot engine:
- Run: https://github.com/github/gh-aw-mcpg/actions/runs/31057249916/job/92667828998?pr=10749
- Prior attempt demonstrating this regression: agent job
92661506653 - The installer selects cached binary
/opt/hostedtoolcache/copilot-cli/1.0.77/x64/bin/copilot, which satisfies the compatibility window1.0.21..1.0.78. activate_cached_copilot_binprepends that directory toPATHand writes it toGITHUB_PATH, then returns without creating/usr/local/bin/copilot.- AWF invokes
copilot_harness.cjswith/usr/local/bin/copilot.
The harness then reports:
pre-flight: command not found: /usr/local/bin/copilot
Spawning fails with ENOENT; Copilot produces no output and exits 1.
The currently linked retry also encountered a separate GitHub Actions Service Unavailable while resolving action downloads. That transient failure is distinct from the prior attempt above, which demonstrates this bug.
Expected behavior
AWF invokes an installed, container-visible Copilot CLI binary and the agent starts successfully regardless of whether installation reused the hosted runner toolcache.
Actual behavior
AWF receives the constant /usr/local/bin/copilot from pkg/constants.CopilotBinaryPath, used by pkg/workflow/copilot_engine_execution.go, even though toolcache activation did not create that path. The harness cannot find or spawn the executable.
Root cause
Toolcache activation added by PR #49116 / commit 5adcdb6d4ec1 introduced three-level Copilot CLI version priority and permits returning after PATH activation. AWF execution retained its absolute-path contract. This creates a mismatch whenever the compatible CLI exists only under /opt/hostedtoolcache.
The failure occurs after gVisor installation, AWF installation, image pulls, and MCP gateway startup all succeed; it is not a gh-aw-firewall failure.
Proposed fixes
- Preferred: Resolve the installed CLI dynamically with
command -v copilot, then pass or stage that resolved path for AWF. Ensure the executable path is mounted and visible inside the chroot/container. - Alternative: When activating a cached binary for standard AWF runs, always create
/usr/local/bin/copilotas a wrapper that execs the cached binary, even whenGITHUB_PATHis set./optmust remain visible inside AWF.
Regression test criteria
Add coverage for a standard hosted runner with AWF enabled and a compatible Copilot CLI already in toolcache. Assert that the generated harness invocation references an existing, container-visible executable rather than an absent /usr/local/bin/copilot, and that Copilot starts without ENOENT.
Activity
Evangelink commentedon Aug 6, 2026
We are impacted and happy to dogfood the fix if you are interested (see microsoft/testfx#10438)