Repository navigation
Harden temporary files and fix Windows installer test compatibility - #76974
Conversation
…aller logs Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ 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 Code Quality Reviewer completed the code quality review.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: 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! PR Specification 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.
|
|
✅ Ponytail Reviewer completed successfully!
|
There was a problem hiding this comment.
What this change does: It makes temporary output and diagnostic files private and cleans them up. It also skips Unix-specific installer tests on Windows.
One simplification is noted inline: the installer can print diagnostics directly without saving and replaying them.
Verdict: fix 1 first.
Lean: -10 lines possible.
Generated by ✂️ Ponytail Reviewer for #76974 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 181
Comment /ponytail to run again
There was a problem hiding this comment.
Found two blocking issues: the new private log allocation failure aborts installation instead of preserving the manual fallback, and the new regression suite is skipped on the Windows environments this change targets. Inline comments explain the required fixes. Static review only; tests were not run per review instructions.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~6 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Regarding the Matt Pocock Skills Reviewer notification: no code change is needed because this is a review-start notification, not actionable feedback. |
|
Regarding the Test Quality Sentinel notification: no code change is needed because this announces analysis without requesting a fix. |
|
Regarding the PR Code Quality Reviewer notification: no code change is needed because this is a progress update with no actionable finding. |
|
Regarding the Design Decision Gate notification: no code change is needed because this only announces a check and does not request a design record or identify a missing one. |
|
Regarding the PR Specification Reviewer notification: no code change is needed because this is a processing notification without a specification finding. |
|
Regarding the Ponytail Reviewer notification: the notification itself needs no code change. The subsequent inline simplification suggestion was accepted and addressed in 46eae24, and its thread is resolved. |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /diagnosing-bugs. Requesting changes on test wiring, platform coverage, and one behavior change in the commit step.
📋 Key Themes & Highlights
Key Themes
- Untested new path: the commit-diagnostics tests are not referenced by the Makefile or any workflow, so they never run.
- Unguarded Windows assertions: the new symlink and
0o700mode checks inmcp_handler_shell.test.cjshave no platform skip. - Hard-fail change: under
set -euo pipefail, anmktempfailure now fails the always-run commit step.
Positive Highlights
- ✅ Private
mktempdirectories andwx+fd-based reads close the fixed-name symlink race. - ✅ Cleanup ordering in the JS
finallyis correct: outputs are read through the fd before the directory is removed. - ✅ Installer trap is safe under
set -u, becauseSTAGING_DIRandGH_INSTALL_LOG_DIRare initialized before the trap is set. - ✅ The test-exit semantics in the
test_private_*subshells propagate failures correctly.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| ) | ||
|
|
||
| echo "Test 4: Private commit diagnostics preserve behavior and clean up" | ||
| for scenario in success error benign allocation-failure; do |
There was a problem hiding this comment.
[/tdd] The new Test 4 never runs in CI. commit_cache_memory_git_test.sh is not listed in the Makefile test targets (around line 573) or in any workflow, so the sentinel, legacy-link, and allocation-failure guarantees are unverified.
💡 Suggested wiring
Add a line next to the other _test.sh entries in the Makefile, for example:
bash actions/setup/sh/commit_cache_memory_git_test.shand make sure the target runs in a CI job, so that regressions in the private-diagnostics path are caught.
@copilot please address this.
| const sentinel = path.join(tempDir, "sentinel"); | ||
| fs.writeFileSync(sentinel, "external=unchanged"); | ||
| const legacyPath = path.join(tempDir, `mcp-shell-output-123-${(0.5).toString(36).substring(2)}.txt`); | ||
| fs.symlinkSync(sentinel, legacyPath); |
There was a problem hiding this comment.
[/tdd] The symlink test and the POSIX mode assertion on line 212 are unguarded. fs.symlinkSync typically needs elevated rights on Windows, and mode & 0o777 is not meaningful there, so this test would fail on Windows if vitest ever ran there.
💡 Suggested guard
Wrap the symlink and mode cases in a platform guard, for example it.skipIf(process.platform === "win32")(...), or skip the mode check on win32. This keeps the Linux coverage while avoiding false failures on Windows.
@copilot please address this.
| # Commit on the current integrity branch; allow empty commits in case | ||
| # the agent made no changes (idempotent). | ||
| if git -c commit.gpgSign=false commit --no-verify --allow-empty -m "run-${RUN_ID}" -q 2>/tmp/gh-aw-commit-err; then | ||
| COMMIT_TEMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/gh-aw-commit.XXXXXX") |
There was a problem hiding this comment.
[/diagnosing-bugs] This is a behavior change. Under set -euo pipefail, an mktemp failure now aborts the post-agent commit step. That step runs with if: always() and no continue-on-error, so a failure in diagnostics-only plumbing now fails the job. The previous path was best-effort.
💡 Suggested fix
If the hard failure is not intended, fall back to a non-fatal path (for example, log a warning and skip the diagnostics file) instead of exiting. The test at allocation failure propagates currently locks in the hard failure, so update it too if the fallback is chosen. If the hard failure is intended, state that in the PR description.
@copilot please address this.
|
Regarding 6808032547: no code change is needed because this is a review-start notification, not actionable feedback. |
|
Regarding 6808032956: completion is noted, with no specific fix requested. The reported_no_action result is not treated as proof of tests or publication. |
|
Regarding 6808032976: the completion notification itself needs no code change. Its two separate inline findings are addressed by 46eae24 and have received individual replies. |
|
Regarding 6808033653: no missing ADR or actionable design finding is supplied, so no change is needed. The reported_no_action status does not establish implementation correctness or publication. |
|
Regarding 6808033963: no specification finding requiring a change is supplied. The reported_no_action status is not treated as validation evidence. |
|
Regarding 6808034339: the completion notification needs no code change. The separate installer simplification suggestion was implemented in 46eae24. |
|
Regarding 6808273033: the earlier assessment still holds; the linked review-start notification requests no code change. |
|
Regarding 6808273348: the original notification now reports completion rather than ongoing analysis. It still supplies no specific fix, so no code change is needed. |
|
Regarding 6808273676: the original notification now reports completion. Its separate inline findings are both addressed by 46eae24; the status comment itself needs no code change. |
|
Regarding 6808274024: the gate now reports completion but identifies no missing ADR requiring a change. No code change is needed for this acknowledgment. |
|
Regarding 6808274346: the specification review now reports completion rather than processing, without a finding requiring action. No code change is needed. |
|
Regarding 6808274745: this acknowledgment correctly records the simplification in 46eae24 and resolution of its thread. No further code change is needed. |
There was a problem hiding this comment.
🟡 Changes recommended
Scenario subshells inherit TESTS_FAILED, causing earlier failures to incorrectly mark later passing scenarios as failed.
1 open issue
What changed in this PR
Hardens temporary-file handling in gh-aw’s installer and action helpers, incorporating the work from #76954 and adapting installer regression tests for Windows shell behavior.
Changes:
- Store cache diagnostics and installer logs in private temporary directories with cleanup.
- Allocate MCP shell outputs exclusively and retain the original file descriptor for readback.
- Add regression coverage and skip Unix-dependent installer-log scenarios on Windows hosts.
| File | Description |
|---|---|
scripts/test-install-script.sh |
Adds private-log regressions, symlink verification, and Windows skips. |
install-gh-aw.sh |
Uses private installer logs and centralized cleanup. |
actions/setup/sh/commit_cache_memory_git.sh |
Isolates commit diagnostics and cleans up temporary files. |
actions/setup/sh/commit_cache_memory_git_test.sh |
Adds diagnostic, cleanup, and allocation-failure regressions. |
actions/setup/js/mcp_handler_shell.test.cjs |
Tests private allocation, safe readback, and cleanup. |
actions/setup/js/mcp_handler_shell.cjs |
Creates private outputs exclusively and reads through the original descriptor. |
actions/setup-cli/install.sh |
Mirrors installer log hardening and cleanup. |
Review effort: Max (auto)
| echo "" | ||
|
|
||
| test_private_commit_diagnostics() ( | ||
| local scenario="$1" |
|
🎉 This pull request is included in a new release. Release: |

Summary
Private installer-log regression tests introduced in #76954 failed on Windows because Git Bash/MSYS symlink and permission behavior differs from Unix. Skip only these Unix-dependent scenarios on MINGW, MSYS, and Cygwin, and verify that the planted symlink exists before running the installer on supported hosts.
This branch also includes the temporary-file hardening from #76954: private cache-commit diagnostics and installer logs, exclusive MCP shell-output allocation, cleanup, and regression coverage. The changes overlap #76954, and the focused Windows test fix has already been pushed to that PR as well.
Validation
Hosted Windows execution remains unverified. No workflows were manually dispatched.
Relates to #76954.