gh-aw icon indicating copy to clipboard operation
gh-aw copied to clipboard

ARC/DinD: `Create gh-aw temp directory` creates `/tmp/gh-aw/agent` on the runner, not inside the chroot

Open jonas-harmoney opened this issue 2 months ago • 2 comments

Follow-up to #59935, same class of problem, different directory.

On ARC/DinD the runner and the Docker daemon have separate root filesystems. The Create gh-aw temp directory step runs create_gh_aw_tmp_dir.sh as a normal runner step, so the directory is created on the runner. The agent then runs inside the AWF chroot on the daemon filesystem, where that directory does not exist.

Environment

  • gh-aw v0.89.20
  • Actions Runner Controller, containerMode: dind
  • runner: topology: arc-dind in the workflow frontmatter
  • self-hosted runner scale set on GKE

What happens

The step reports success on the runner:

agent  Create gh-aw temp directory
Created /tmp/gh-aw/agent directory for agentic workflow temporary files

The generated safe-output instructions tell the agent to stage payloads under /tmp/gh-aw/, for example:

cat <<'EOF' > /tmp/gh-aw/body.md
jq -Rs '{title: "My title", body: .}' /tmp/gh-aw/body.md | safeoutputs create_discussion .

Inside the chroot that path does not exist, so the heredoc fails silently and the safe output is emitted with an empty field:

  │ cat > /tmp/gh-aw/agent/body.md <<'EOF'
[INGESTION] First 500 chars of output: {"body":"","pull_request_number":<pr>,"title":"<title>","type":"update_pull_request"}

The agent detected this itself and retried with an explicit mkdir -p, which worked:

  │ mkdir -p /tmp/gh-aw/agent && cat > /tmp/gh-aw/agent/body.md <<'EOF'

but the retry was rejected by the max: 1 limit on update_pull_request, so the run ended with a report_incomplete and a pull request with a correct title and an empty body. The agent's own summary:

The first update_pull_request call was emitted with an empty body because /tmp/gh-aw/agent/ did not exist and the heredoc writing the body file failed silently before jq ran.

Impact

Any safe output that stages its payload through a file loses that payload on ARC/DinD. The failure is silent: the field is emitted empty rather than erroring, so the run can report success with an empty body. Raising max only makes recovery possible, it does not prevent the first wasted call.

Suggested fix

The same treatment as #62755: create the directory where the agent will actually see it, or stage it under RUNNER_TEMP and point the generated instructions at that path. Because the path comes from gh-aw's own generated prompt, a workflow author cannot work around this by choosing a different directory.

Possibly related

Also seen on the same runs, on both the agent and detection jobs:

[copilot-harness] awf-reflect: unable to persist reflect payload to
/home/runner/_work/_temp/awf-reflect.json: EACCES: permission denied

and in the detection job, three times:

[engine]   └ Permission denied and could not request permission from user

Happy to split those into their own issue if they are unrelated.

jonas-harmoney avatar Sep 23 '26 11:09 jonas-harmoney

🔗 AWF tracking issue: github/gh-aw-firewall#8938

Generated by Firewall Issue Dispatcher · copilot · auto · 26 AIC · ⊞ 9.2K · ◷

lpcox avatar Sep 24 '26 01:09 lpcox

Fixed in https://github.com/github/gh-aw-firewall/issues/8932

lpcox avatar Sep 24 '26 01:09 lpcox