Problem
When the Copilot CLI runs inside the AWF sandbox (Docker container), the session-state events.jsonl file is written to $HOME/.copilot/session-state/ inside the container. The compiled workflow's "Copy Copilot session state files to logs" step reads from the host's $HOME/.copilot/session-state, which is empty because the CLI ran in the container.
As a result, the agent_outputs artifact contains only process-*.log — no events.jsonl — making conversation-level debugging and benchmarking impossible for AWF-wrapped Copilot CLI runs.
Context
Root Cause
Looking at src/docker-manager.ts lines 898–899 and 962–966, AWF does mount the session-state directory:
// Line 898-899
`\$\{sessionStatePath}:\$\{effectiveHome}/.copilot/session-state:rw`,
// Line 962-966
agentVolumes.push(`\$\{sessionStatePath}:/host\$\{effectiveHome}/.copilot/session-state:rw`);
The sessionStatePath defaults to \$\{workDir}/agent-session-state (line 463). The session-state data is accessible in \$\{workDir}/agent-session-state/ after the run, and performCleanup() moves it to /tmp/awf-agent-session-state-<timestamp> (lines 2674–2681).
The gap is in the compiled workflow's artifact upload step: it copies from $HOME/.copilot/session-state on the host (which is empty), not from the AWF-managed path. This is a gap in postprocess-smoke-workflows.ts or the compiled workflow template.
Proposed Solution
-
scripts/ci/postprocess-smoke-workflows.ts: When post-processing smoke/build-test lock files, find the "Copy Copilot session state files to logs" step and rewrite the copy source path from $HOME/.copilot/session-state to \$\{AWF_SESSION_STATE_DIR:-/tmp/awf-agent-session-state-*} — or emit an explicit AWF-managed path.
-
src/cli.ts / src/docker-manager.ts: Export the session-state path as an environment variable (e.g., AWF_SESSION_STATE_DIR) after the run completes, so downstream steps can reference it reliably without glob patterns.
-
src/docker-manager.ts performCleanup(): When preserving session-state (lines 2674–2681), write the final path to a well-known file (e.g., \$\{workDir}/.awf-session-state-path) so the workflow step can read it with cat.
-
Compiled workflow template: Update the session-state copy step to use the AWF-managed path. This requires changes to the gh-aw compiler workflow template for engine.id: copilot.
Generated by Firewall Issue Dispatcher · ● 1.6M · ◷
Problem
When the Copilot CLI runs inside the AWF sandbox (Docker container), the session-state
events.jsonlfile is written to$HOME/.copilot/session-state/inside the container. The compiled workflow's "Copy Copilot session state files to logs" step reads from the host's$HOME/.copilot/session-state, which is empty because the CLI ran in the container.As a result, the
agent_outputsartifact contains onlyprocess-*.log— noevents.jsonl— making conversation-level debugging and benchmarking impossible for AWF-wrapped Copilot CLI runs.Context
Root Cause
Looking at
src/docker-manager.tslines 898–899 and 962–966, AWF does mount the session-state directory:The
sessionStatePathdefaults to\$\{workDir}/agent-session-state(line 463). The session-state data is accessible in\$\{workDir}/agent-session-state/after the run, andperformCleanup()moves it to/tmp/awf-agent-session-state-<timestamp>(lines 2674–2681).The gap is in the compiled workflow's artifact upload step: it copies from
$HOME/.copilot/session-stateon the host (which is empty), not from the AWF-managed path. This is a gap inpostprocess-smoke-workflows.tsor the compiled workflow template.Proposed Solution
scripts/ci/postprocess-smoke-workflows.ts: When post-processing smoke/build-test lock files, find the "Copy Copilot session state files to logs" step and rewrite the copy source path from$HOME/.copilot/session-stateto\$\{AWF_SESSION_STATE_DIR:-/tmp/awf-agent-session-state-*}— or emit an explicit AWF-managed path.src/cli.ts/src/docker-manager.ts: Export the session-state path as an environment variable (e.g.,AWF_SESSION_STATE_DIR) after the run completes, so downstream steps can reference it reliably without glob patterns.src/docker-manager.tsperformCleanup(): When preserving session-state (lines 2674–2681), write the final path to a well-known file (e.g.,\$\{workDir}/.awf-session-state-path) so the workflow step can read it withcat.Compiled workflow template: Update the session-state copy step to use the AWF-managed path. This requires changes to the gh-aw compiler workflow template for
engine.id: copilot.