Skip to content

[awf] copilot-harness: spawn /usr/local/bin/copilot ENOENT on tool-cache hit #7130

Closed as not planned

Description

@lpcox

Problem
Copilot-engine workflows fail with spawn /usr/local/bin/copilot ENOENT when the runner already has copilot-cli in the tool cache, because the installer skips creating the /usr/local/bin/copilot wrapper on cache hits.

Context
github/gh-aw#51373

Root Cause
install_copilot_cli.sh's activate_cached_copilot_bin() prepends the cached dir to PATH and returns early when GITHUB_PATH is set (always true in Actions), skipping the wrapper install step (install -m 0755 wrapper_path INSTALL_DIR/copilot) that the fresh-download path performs. The compiler-emitted harness (copilot_harness.cjs) always spawns the hardcoded absolute path /usr/local/bin/copilot (constant CopilotBinaryPath), so it fails when only PATH was updated.

Proposed Solution
Either (a) have activate_cached_copilot_bin() still install/symlink the wrapper to INSTALL_DIR/copilot even when GITHUB_PATH is set, or (b) make the harness resolve copilot via PATH lookup instead of a hardcoded absolute path, falling back to the constant only if PATH resolution fails. Note any AWF sandbox interaction with /usr/local/bin mount visibility for cached binaries.

Generated by Firewall Issue Dispatcher · auto · 26.4 AIC · ⊞ 8.9K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions