Repository navigation
Description
Summary
On a self-hosted runner, the agent container inherits the runner user's $HOME, and two gh-aw behaviors depend on that directory:
- The firewall mounts
/dev/nullover credential files under$HOME. If$HOMEis on NFS, Docker runs as root and cannot create those paths, so the container never starts. - After the agent step,
copy_copilot_session_state.shcopies every Copilot session under$HOME/.copilot/session-statewhen the job's own session directory is empty. On a runner user that already has local Copilot history, that copy fills the disk and the log parser crashes.
A private empty home on local disk avoids both. There is no frontmatter setting for the home directory, so the workaround lives outside the workflow.
Environment
- gh-aw v1.2.2, stock compile
- Self-hosted Linux runner, not ARC/DinD
runner.installation: rootless- Runner user's
$HOMEis an NFS mount - That user has an existing
~/.copilot/session-statefrom normal Copilot CLI use - Docker is available
1. Container cannot start when $HOME is on NFS
The agent step does not set HOME. AWF starts the container with the runner user's home, then mounts /dev/null over credential paths under that home.
Observed:
error mounting "/dev/null" to rootfs at "/host$HOME/.config/glab-cli/config.yml":
lstat .../merged/host$HOME/.config/glab-cli: permission denied
docker compose up exits 1, and the agent produces no output. Root can create the same paths on a local filesystem. This is the NFS root-squash restriction, and there is no frontmatter field for a different home.
2. Session copy reads every session in $HOME
actions/setup/sh/copy_copilot_session_state.sh (v1.2.2) picks a source in this order:
/tmp/gh-aw/sandbox/agent/session-state, the current job's session.- Otherwise
$HOME/.copilot/session-state, the runner user's whole history.
When the first directory has no redactable files, the script copies every matching file from the second. The job log shows:
Copying Copilot session state from $HOME/.copilot/session-state to /tmp/gh-aw/sandbox/agent/logs/copilot-session-state
cp: error writing '...': No space left on device
Failed to write agent output file: ENOSPC: no space left on device, open '/tmp/gh-aw/agent_output.json'
ERR_API: Maximum call stack size exceeded
The parser then emits one Agent source: .../events.jsonl line per past session, not only the session from this run. The current job's session is the directory under /tmp/gh-aw/sandbox/agent/session-state. The fallback should not copy unrelated sessions.
Expected
- A way to give the agent job a home directory that is not the runner user's real home, or a mount policy that does not require root to create paths under
$HOMEwhen it is on NFS. - Copy and parse only the session created by the current run. If the job's own session directory is empty, skip the copy instead of reading
$HOME/.copilot/session-state.
Workaround we used
Outside the workflow, point the runner at an empty home on local disk and clear its session directory before each job:
HOME=/var/tmp/runner-home-<runner-name>
ACTIONS_RUNNER_HOOK_JOB_STARTED=<path-to-a-script-that-empties-$HOME/.copilot/session-state>
The real $HOME/.copilot is then never read. This is a runner configuration change, not a workflow setting, and sessions still accumulate in the new home unless the hook keeps clearing them.
Notes
- Separate from Self-hosted: isolate each job's runtime directory and scope cleanup without sudo #75441. That issue is the shared
/tmp/gh-awdirectory. This one is$HOME. - An empty home hides problem 2, which is why it does not show up on a fresh runner user.
Activity
lpcox commentedon Nov 17, 2026