Repository navigation
Scope Copilot session artifacts to the current job - #78804
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Specification Reviewer completed successfully! Caution agentic threat detected DetailsPotential security threats were detected in the agent output. Detected threat types: prompt injection. Review the workflow run logs for details. PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found one correctness gap: the shell copy step no longer falls back to HOME, but durable session capture still does, so historical Copilot sessions may remain in scope for durable workflows. Please align both capture paths. No tests were run per static-review instructions.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again
|
|
||
| AWF_SESSION_STATE_DIR="${GH_AW_COPILOT_SESSION_STATE_DIR:-/tmp/gh-aw/sandbox/agent/session-state}" | ||
| LEGACY_SESSION_STATE_DIR="${GH_AW_COPILOT_LEGACY_SESSION_STATE_DIR:-$HOME/.copilot/session-state}" | ||
| SESSION_STATE_DIR="${GH_AW_COPILOT_SESSION_STATE_DIR:-/tmp/gh-aw/sandbox/agent/session-state}" |
There was a problem hiding this comment.
This removes the HOME fallback only from this shell copy step, but durable_session.cjs still independently falls back to $HOME/.copilot/session-state, so unrelated historical sessions can still be captured during durable capture; please update that path or otherwise make both capture mechanisms use the same AWF-managed source.
💡 Keep durable session capture scoped consistently
captureCopilotSessions still builds a candidate list containing path.join(home, ".copilot/session-state") and recursively copies the first non-empty candidate. As a result, this change does not fully enforce the stated isolation boundary for workflows using durable capture. Remove the HOME candidate (and add regression coverage) or explicitly gate it to a compatible, job-owned directory.
There was a problem hiding this comment.
Durable capture now uses the baseline session UUID and copies only that session from AWF state or COPILOT_HOME; it does not recursively copy HOME history. The direct-mode exact-session path is covered by regression tests (aa87696).
Comment MemoryPeek at saved memory (spec-review-history)History |
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd (test coverage and hygiene) and /diagnosing-bugs (root cause vs symptom). The fix addresses the root cause by removing the $HOME fallback rather than guarding it. Targeted tests (go test ./pkg/workflow -run TestCopilotSession) pass and shellcheck is clean. One small cleanup is suggested inline.
📋 Key Themes & Highlights
Key Themes
- Dead test override:
GH_AW_COPILOT_LEGACY_SESSION_STATE_DIRis still set by the test helper but no longer read by the script. - Adjacent fallback (outside this diff):
actions/setup/js/durable_session.cjs(captureCopilotSessions, line 38) still falls back to~/.copilot/session-state, the same runner-HOME history pattern this PR removes. Its test (durable_session.test.cjs, line 138) codifies that behavior, so it looks deliberate. Worth a follow-up issue rather than a blocker here.
Positive Highlights
- ✅ Root-cause fix: the HOME fallback is removed, not just guarded.
- ✅ Regression tests cover empty, missing, and non-redactable AWF directories while populated legacy sessions exist, and assert no legacy reference and no logs directory.
- ✅ Nested job-file collection and redactable-file filtering are preserved and tested.
- ✅ The unusable-directory warning is asserted, so the behavior is observable.
@copilot please address the review comment above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| overrides := map[string]string{ | ||
| "GH_AW_COPILOT_SESSION_STATE_DIR": awfDir, | ||
| "GH_AW_COPILOT_LEGACY_SESSION_STATE_DIR": legacyDir, | ||
| "GH_AW_COPILOT_LEGACY_SESSION_STATE_DIR": filepath.Join(homeDir, ".copilot", "session-state"), |
There was a problem hiding this comment.
[/tdd] GH_AW_COPILOT_LEGACY_SESSION_STATE_DIR is now dead: copy_copilot_session_state.sh no longer reads it, so this override has no effect. Keeping it implies the legacy path is still configurable and makes the test look like it covers an env-driven fallback.
💡 Suggested change
Delete the GH_AW_COPILOT_LEGACY_SESSION_STATE_DIR entry from overrides. Keep HOME set to homeDir so a reintroduced $HOME fallback is still caught.
@copilot please address this.
There was a problem hiding this comment.
Removed the unused GH_AW_COPILOT_LEGACY_SESSION_STATE_DIR override and kept HOME isolated in the test helper. Commit 7ed2edc9.
|
@copilot address all review feedback |
There was a problem hiding this comment.
🟡 Changes recommended
The session-state copy logic drops valid direct-mode artifacts, causing resumed durable CLI jobs to fail with ENOENT when events.jsonl is missing.
1 open issue
What changed in this PR
Scopes gh-aw’s Copilot session-log collection to AWF-managed job state, preventing unrelated runner history from filling artifacts and exhausting disk.
Changes:
- Removes the runner HOME fallback and exits successfully with a warning when job state is missing, empty, or contains no redactable files.
- Adds regression coverage with populated historical sessions while preserving nested-file collection and redactable-file filtering.
| File | Description |
|---|---|
pkg/workflow/copilot_session_copy_test.go |
Tests job-only collection and skipped collection despite populated historical sessions. |
actions/setup/sh/copy_copilot_session_state.sh |
Removes the HOME fallback and handles unusable job state without copying. |
Review effort: Max (adaptive)
| if [ ! -d "$SESSION_STATE_DIR" ] || ! has_redactable_files "$SESSION_STATE_DIR"; then | ||
| echo "::warning::No Copilot session state files found in $SESSION_STATE_DIR" | ||
| exit 0 |
There was a problem hiding this comment.
Direct-mode durable capture now selects only the session UUID recorded in the capture baseline, and the shell collector uses that same UUID filter. Regression coverage exercises the direct-mode path without restoring an unbounded HOME fallback (aa87696).
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
@copilot fix this failing ci check https://github.com/github/gh-aw/actions/runs/44160393757/job/134312571413?pr=78804 |
Fixed direct-mode durable collection to copy only the session UUID from its capture baseline, and narrowed durable checkpoints to that session. Added regression coverage; commit |
The Copilot-session Go/JS tests and final
Addressed the review findings: durable capture is scoped to the current session UUID, and the test no longer sets the unused legacy override. Commit |
| const source = candidates.find(directory => fs.existsSync(directory) && fs.readdirSync(directory).length); | ||
| const baseline = readCopilotCaptureBaseline(destination); | ||
| if (!baseline) { | ||
| console.info("Copilot did not produce native durable session files"); |
There was a problem hiding this comment.
Replaced the ad hoc console.info calls with the durable-session logger and updated the regression test. Commit 0d9801ce.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "0d9801ce2ed518a85283a9274e7deeb08e8ab143",
"kind": "requested",
"schema_version": "1",
"state": "3607de81362a799f2cf0df04ee273925fcc1b86ea50d7c1bda0b68058848241d",
"work": [
"41c633c50467b0f2dc87116833139ebf287e1ad59f1a015d8d1dfedd9d1b23f1"
],
"workflow": "pr-sous-chef"
}
|
…opilot-session-history Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Updated the PR branch from |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "07ad79173a08b4e9f204aa9eae763ce14c154e9b",
"kind": "requested",
"schema_version": "1",
"state": "56a5b9dd1130e1b42cb0f00875348a49d5b85d526e6595817a190cecb7c3e8c1",
"work": [
"42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac",
"47f188a12b316525c2202f4f75b82185d76be0a140c0f99eae185cf2b7d8acb1"
],
"workflow": "pr-sous-chef"
}
|
…opilot-session-history Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Merged |
| SOURCE_DIR="" | ||
| if [ -n "$SESSION_ID" ]; then | ||
| COPILOT_HOME="${COPILOT_HOME:-$HOME/.copilot}" | ||
| for candidate in "$SESSION_STATE_DIR" "$COPILOT_HOME/session-state"; do |
There was a problem hiding this comment.
Capture baselines now include the current GITHUB_RUN_ID and GITHUB_RUN_ATTEMPT; stale baselines are ignored by copy, capture, and trim paths. Regression coverage was added in c42f900.
|
Warning Threat detection engine error Threat detection could not complete its analysis due to a tooling error. This is not a security finding. What happenedThe threat detection results could not be parsed. Review the workflow run logs to troubleshoot the error. 🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "19947810a5d57549f97d8ee60074231bd6790900",
"kind": "requested",
"schema_version": "1",
"state": "cc13d3d500c1033648315823113037e6f4ab5b9536c464aff0b4df4fc4ff626e",
"work": [],
"workflow": "pr-sous-chef"
}
|
…opilot-session-history # Conflicts: # .github/workflows/cgo.yml # actions/setup/js/resolve_model_alias.test.cjs Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Merged the latest |

An empty AWF session directory could trigger collection of the runner user’s entire Copilot history, exhausting disk and feeding unrelated sessions into artifact parsing.
$HOME/.copilot/session-statefallback; collect only AWF-managed job state.