Bug: arc-dind generated Copilot CLI staging step fails when source and destination are the same file
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Bắt đầu trong pkg/workflow/nodejs.go, nơi bước staging arc-dind được phát ra, và tìm chuỗi tạo lệnh cp vô điều kiện của $(command -v copilot) vào ${RUNNER_TEMP}/gh-aw/bin. Bọc bản sao trong guard định danh -ef từ báo cáo, giữ nguyên mkdir -p và chmod +x, sau đó cập nhật các tệp golden generated-workflow dưới pkg/workflow testdata và chạy go test ./pkg/workflow/... — hoàn tất nghĩa là lockfile đã biên dịch cho một repro runner.topology: arc-dind hiển thị bản sao được bảo vệ và các test khớp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When using "runner.topology: arc-dind" with GitHub Agentic Workflows ("gh-aw") v1.2.2 on a non-root self-hosted runner, the generated workflow fails at the Copy Copilot CLI to daemon-visible path step.
The rootless Copilot CLI installer already places the binary at:
${RUNNER_TEMP}/gh-aw/bin/copilot
However, the "arc-dind" workflow generator subsequently attempts to copy the binary to that exact same location.
This causes "cp" to fail with exit code 1, preventing execution from proceeding to MCP Gateway startup and the Copilot agent.
Environment
- gh-aw version: "v1.2.2"
- GitHub Actions runner: self-hosted Linux, non-root user (UID 1000)
- Runner topology: "arc-dind"
- Docker Desktop Engine: "29.6.2"
- Docker-in-Docker: dedicated privileged sidecar
- Docker transport: TCP "127.0.0.1:2375"
- Firewall: AWF "v0.29.11"
- Copilot CLI: "1.0.103"
- Workflow trigger: "workflow_dispatch"
The issue occurs with a non-ARC Docker Compose deployment using the documented "arc-dind" topology.
Steps to reproduce
- Configure an agentic workflow with the ARC/DinD topology
Create a workflow such as ".github/workflows/repro.md":
on:
workflow_dispatch:
permissions:
contents: read
engine:
id: copilot
runs-on: [self-hosted, linux, my-ai-runner]
runner:
topology: arc-dind
Reproduction test
Respond with a short confirmation message.
- Compile the workflow using gh-aw v1.2.2
gh aw version
gh aw compile repro
- Inspect the generated workflow
The generated ".github/workflows/repro.lock.yml" contains a step equivalent to:
-
name: Install GitHub Copilot CLI
run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" ... --rootless ... -
name: Copy Copilot CLI to daemon-visible path
run: |
mkdir -p "${RUNNER_TEMP}/gh-aw/bin"
COPILOT_SRC="$(command -v copilot)"
cp "$COPILOT_SRC" "${RUNNER_TEMP}/gh-aw/bin/copilot"
chmod +x "${RUNNER_TEMP}/gh-aw/bin/copilot"
- Run the workflow on a configured DinD self-hosted runner
The rootless installation places "copilot" in "${RUNNER_TEMP}/gh-aw/bin", which is added to "PATH".
Consequently, the staging step attempts to copy the file onto itself.
Actual behavior
cp: '/home/node/actions-runner/_work/_temp/gh-aw/bin/copilot'
and '/home/node/actions-runner/_work/_temp/gh-aw/bin/copilot'
are the same file
Error: Process completed with exit code 1.
The workflow stops before MCP Gateway startup and agent execution.
Expected behavior
The generated staging step should recognize when the Copilot CLI is already located at the daemon-visible destination and skip the redundant copy.
It should still copy the binary when the source and destination are different files.
Root cause
In "pkg/workflow/nodejs.go", gh-aw v1.2.2 generates the copy unconditionally when Copilot staging is required with AWF enabled and "runner.topology: arc-dind".
The rootless installer already installs the binary to the destination expected by the staging step.
There is no file-identity check before calling "cp".
Suggested fix
Generate an idempotent staging step that checks file identity before copying:
set -euo pipefail
COPILOT_SRC="$(command -v copilot)"
COPILOT_DEST="${RUNNER_TEMP}/gh-aw/bin/copilot"
mkdir -p "$(dirname "$COPILOT_DEST")"
if [[ ! "$COPILOT_SRC" -ef "$COPILOT_DEST" ]]; then
cp "$COPILOT_SRC" "$COPILOT_DEST"
fi
chmod +x "$COPILOT_DEST"
The "-ef" check handles identical paths, hard links and symlinks resolving to the same file.
This should preserve the existing staging behavior without weakening integrity verification, AWF, or sandbox enforcement.
Validation performed
- Confirmed the unconditional copy in gh-aw v1.2.2 source.
- Confirmed rootless installation targets "${RUNNER_TEMP}/gh-aw/bin".
- Reproduced the failure on a self-hosted DinD runner.
- Locally verified the proposed file-identity guard for identical paths, distinct files, hard links and symlinks.
- Confirmed that the generated staging step is present in both agent and threat-detection jobs.
- Confirmed that gh-aw compilation and validation succeed despite the runtime failure.
- No manual modifications to generated lockfiles were made.
The same unconditional staging logic was also observed during source inspection of v1.2.3 and v1.3.0; runtime reproduction was performed with v1.2.2 only.
References
- "Copilot CLI installer v1.2.2" (https://github.com/github/gh-aw/blob/v1.2.2/actions/setup/sh/install_copilot_cli.sh)
- "Workflow generator v1.2.2" (https://github.com/github/gh-aw/blob/v1.2.2/pkg/workflow/nodejs.go)
- "Runner configuration v1.2.2" (https://github.com/github/gh-aw/blob/v1.2.2/pkg/workflow/runner_config.go)
- "Self-hosted runner documentation" (https://github.com/github/gh-aw/blob/v1.2.2/docs/src/content/docs/reference/self-hosted-runners.md)
Additional context
The DinD runner itself passed qualification, including container execution, shared workspace visibility and Unix socket connectivity. The failure is isolated to the generated Copilot CLI staging step.
A minimal upstream fix would make the step safe and idempotent for rootless ARC/DinD deployments.
- Ngôn ngữ chính
- Go
- Star
- 5.7k
- Fork
- 635
- Merge trung bình
- 3 giờ 43 phút
- Pull request đã merge (30 ngày)
- 838
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/gh-aw
-
automation backlog:reports documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-inspected
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
github/gh-aw#80646 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-inspected
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
automated-analysis backlog:engineering-quality code-quality cookie refactoring
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-inspected backlog:security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
github/gh-aw#79301 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
unbound-force/replicator#193 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
A Gemini stream that fails partway completes the call with the partial textCó thể đã có người làm @bnaylor đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
go-steer/core-agent#1600 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug raised-by:reviewer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
medici-finance/assay#7655 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add /exit and /quit commandsĐang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Edwin-metcalf/MetCode#67 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày