You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do not copy the runner user’s entire Copilot session history when job session state is empty #78554
actions/setup/sh/copy_copilot_session_state.sh falls back from the AWF-managed job session directory to $HOME/.copilot/session-state. On persistent self-hosted runners, that fallback can copy every historical Copilot CLI session owned by the runner user into the current job's logs.
This is the session-collection portion of #76904. It should be tracked separately from the NFS container-mount failure because it has a different owner, failure mode, and fix.
Current behavior
The script selects its source in this order:
/tmp/gh-aw/sandbox/agent/session-state when it contains a redactable file.
Otherwise, all of $HOME/.copilot/session-state when that tree contains a redactable file.
It then recursively copies every matching file from the selected tree. If the job-owned directory is empty and the runner user has substantial Copilot CLI history, the job may copy unrelated sessions until the disk fills. Downstream log parsing then processes sessions unrelated to the current run and can fail after the disk is exhausted.
Representative failures include:
cp: error writing '...': No space left on device
Failed to write agent output file: ENOSPC: no space left on device
ERR_API: Maximum call stack size exceeded
Expected behavior
Session artifact collection must be scoped to the session created by the current workflow invocation. An empty AWF-managed session directory should result in a warning and no copy, not a recursive scan of the runner user's history.
If compatibility with older AWF versions requires a legacy path, the source must be bounded to a session that can be attributed to the current invocation rather than copying the entire directory.
Acceptance criteria
Current AWF versions never fall back to recursively copying all of $HOME/.copilot/session-state.
An empty job session directory exits successfully with a warning and copies nothing.
Legacy compatibility, if retained, identifies and copies only the current invocation's session.
Tests cover an empty job directory alongside a populated legacy home and verify that historical sessions are not copied.
Artifact parsing receives only session state attributable to the current job.
Current workaround
Give the runner an empty local HOME and clear $HOME/.copilot/session-state before every job. This is external runner configuration and deletes useful state to compensate for unscoped collection.
Activity
github-actions commentedon Nov 17, 2026
Assigning to
@rabeckett: the recent AWF/Codex endpoint work in #78559 is the closest area match for AWF-managed session-state collection.