Skip to content

Agentic workflows fail because Copilot CLI is invoked from missing /usr/local/bin path #48720

Description

@msyyc

Description

The Python Management SDK PR Review agent job fails before Copilot starts because the generated workflow invokes a hard-coded Copilot CLI path that does not exist on the runner.

The setup action successfully resolves and activates Copilot CLI 1.0.80 at:

/opt/hostedtoolcache/copilot-cli/1.0.80/x64/bin/copilot

However, the generated agent command passes this path to copilot_harness.cjs:

/usr/local/bin/copilot

The harness therefore exits immediately with ENOENT, and the workflow produces no review comment.

Failure

[copilot-harness] pre-flight: command not found: /usr/local/bin/copilot (F_OK check failed — binary does not exist at this path)
[copilot-harness] attempt 1: failed to start process '/usr/local/bin/copilot': spawn /usr/local/bin/copilot ENOENT (code=ENOENT syscall=spawn /usr/local/bin/copilot)
[copilot-harness] attempt 1: no output produced — not retrying (possible causes: binary not found, permission denied, auth failure, or silent startup crash)
##[error]Process completed with exit code 1.

Context

The same hard-coded /usr/local/bin/copilot invocation is present in multiple generated .github/workflows/*.lock.yml files, so the impact is not limited to the management SDK review workflow.

Expected behavior

The generated command should invoke the Copilot CLI binary selected by install_copilot_cli.sh, either by resolving copilot from PATH or by passing the activated toolcache path to copilot_harness.cjs.

Suggested fix

Update/regenerate the gh-aw lockfiles with a compiler/runtime version that does not hard-code /usr/local/bin/copilot, or change the generated invocation to use the resolved CLI path. Then validate with:

gh aw compile mgmt-sdk-pr-review
gh aw run mgmt-sdk-pr-review

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions