Skip to content

[awf] Fix tool-cache mount handling, smoke-pi runtime config, and cache-memory git recovery#35802

Merged
pelikhan merged 17 commits into
mainfrom
copilot/fix-nodejs-access-in-chroot
May 30, 2026
Merged

[awf] Fix tool-cache mount handling, smoke-pi runtime config, and cache-memory git recovery#35802
pelikhan merged 17 commits into
mainfrom
copilot/fix-nodejs-access-in-chroot

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

On runners where setup-node installs into non-default tool-cache locations (for example /home/runner/work/_tool via RUNNER_TOOL_CACHE), AWF chroot could not reliably find Node, causing startup failures.

This PR also hardens cache-memory git setup to recover from malformed restored .git metadata that can cause early fatal: not in a git directory failures in workflow setup steps.

What changed

  • AWF command generation: tool-cache mount and PATH handling

    • Added runtime tool-cache detection using:
      • RUNNER_TOOL_CACHE (preferred), fallback /opt/hostedtoolcache
      • legacy fallback /home/runner/work/_tool when present
    • Mounts non-/opt/* tool-cache paths into chroot as read-only.
    • Fixed dynamic mount argument expansion so AWF receives a valid host:container:ro value.
    • Updated PATH reconstruction inside AWF command to include RUNNER_TOOL_CACHE so arbitrary non-/opt caches are discoverable.
  • Smoke Pi workflow updates (follow-up CI feedback)

    • Switched smoke-pi engine model to copilot/gpt-5.4.
    • Added sandbox write access for:
      • ${{ github.workspace }}
      • /tmp/gh-aw/agent
  • Cache-memory setup hardening

    • Updated actions/setup/sh/setup_cache_memory_git.sh to self-heal when restored git metadata is malformed before hook configuration.
    • Added recovery path that reinitializes cache-memory git metadata while preserving restored working-tree files.
    • Switched hook-config stderr capture to a secure temporary file.
    • Added regression coverage in actions/setup/sh/setup_cache_memory_git_test.sh for missing-HEAD corruption recovery.
  • Generated output alignment

    • Recompiled workflow lock output to reflect runtime and smoke-pi configuration changes.

Changeset

  • Type: patch
  • Description: Fixed AWF chroot tool-cache mounting for non-default tool-cache paths and hardened cache-memory git setup to recover from malformed restored metadata.

> Generated by 📋 Changeset Generator for issue #35802 · gpt54 1.2M ·



✨ PR Review Safe Output Test - Run 26672230109

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · opus48 1.1M ·

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Node.js availability in AWF chroot [awf] Mount non-/opt runner tool cache into AWF chroot May 29, 2026
Copilot finished work on behalf of lpcox May 29, 2026 22:25
Copilot AI requested a review from lpcox May 29, 2026 22:25
@pelikhan pelikhan marked this pull request as ready for review May 29, 2026 22:46
Copilot AI review requested due to automatic review settings May 29, 2026 22:46
@pelikhan pelikhan added the smoke label May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

🧪 Test Quality Sentinel completed test quality analysis.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

💫 TO BE CONTINUED... Smoke Claude failed to deliver outputs! Our hero faces unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

PR Code Quality Reviewer completed the code quality review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

Design Decision Gate 🏗️ completed the design decision gate check.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

🚀 Smoke Gemini MISSION COMPLETE! Gemini has spoken. ✨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

🚀 Smoke Antigravity MISSION COMPLETE! Antigravity has spoken. ✨

@github-actions
Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions github-actions Bot removed the smoke label May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

🚀 Smoke Pi MISSION COMPLETE! Pi delivered. 🥧

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates AWF command generation so non-default runner tool-cache directories can be mounted into the AWF chroot, addressing Node/runtime lookup failures on runners that use /home/runner/work/_tool or another RUNNER_TOOL_CACHE.

Changes:

  • Adds a generated shell probe for RUNNER_TOOL_CACHE / legacy _tool detection.
  • Injects ${GH_AW_TOOL_CACHE_MOUNT} into AWF invocations.
  • Updates unit and wasm golden coverage for the generated command shape.
Show a summary per file
File Description
pkg/workflow/awf_helpers.go Adds dynamic tool-cache mount probe and AWF command injection.
pkg/workflow/awf_config_test.go Adds assertions for generated tool-cache mount probe content.
pkg/workflow/testdata/TestWasmGolden_AllEngines/claude.golden Updates Claude golden AWF command output.
pkg/workflow/testdata/TestWasmGolden_AllEngines/codex.golden Updates Codex golden AWF command output.
pkg/workflow/testdata/TestWasmGolden_AllEngines/copilot.golden Updates Copilot golden AWF command output.
pkg/workflow/testdata/TestWasmGolden_AllEngines/gemini.golden Updates Gemini golden AWF command output.
pkg/workflow/testdata/TestWasmGolden_AllEngines/pi.golden Updates Pi golden AWF command output.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden Updates basic Copilot fixture golden output.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/playwright-cli-mode.golden Updates Playwright fixture golden output.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden Updates smoke Copilot fixture golden output.
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden Updates imported fixture golden output.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 11/11 changed files
  • Comments generated: 2

Comment thread pkg/workflow/awf_helpers.go Outdated
Comment on lines +206 to +209
%s="--mount \"$GH_AW_TOOL_CACHE:$GH_AW_TOOL_CACHE:ro\""
fi
elif [ -d "/home/runner/work/_tool" ]; then
%s="--mount \"/home/runner/work/_tool:/home/runner/work/_tool:ro\""
Comment thread pkg/workflow/awf_helpers.go Outdated
Comment on lines +203 to +206
GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"
if [ -d "$GH_AW_TOOL_CACHE" ]; then
if [[ "$GH_AW_TOOL_CACHE" != /opt/* ]]; then
%s="--mount \"$GH_AW_TOOL_CACHE:$GH_AW_TOOL_CACHE:ro\""
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot make merge-main

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

@copilot review all comments and address unresolved review feedback.

Generated by 👨‍🍳 PR Sous Chef · gpt54 8M ·

@github-actions
Copy link
Copy Markdown
Contributor

@copilot refresh the branch, rerun checks, and summarize the remaining blockers.

Generated by 👨‍🍳 PR Sous Chef · gpt54 8M ·

Copilot AI and others added 2 commits May 30, 2026 02:35
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 30, 2026

@copilot review failure of cache-memory https://github.com/github/gh-aw/actions/runs/26671382769/job/78615729329#step:19:1

Investigated run 26671382769 (job 78615729329): step 19 failed in setup_cache_memory_git.sh with fatal: not in a git directory when restored .git metadata was malformed before hook configuration. Fixed in b7acfd9 by validating/recovering repo state before/while setting core.hooksPath, with reinitialization fallback. Added regression coverage in actions/setup/sh/setup_cache_memory_git_test.sh for missing-HEAD corruption recovery, and the updated script tests pass.

Copilot AI and others added 2 commits May 30, 2026 02:37
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [awf] Fix tool-cache mount handling and update smoke-pi runtime config [awf] Fix tool-cache mount handling, smoke-pi runtime config, and cache-memory git recovery May 30, 2026
@pelikhan pelikhan added the smoke label May 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

🚀 Smoke Pi MISSION COMPLETE! Pi delivered. 🥧

@github-actions
Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

🚀 Smoke Antigravity MISSION COMPLETE! Antigravity has spoken. ✨

@github-actions github-actions Bot removed the smoke label May 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

🚀 Smoke Gemini MISSION COMPLETE! Gemini has spoken. ✨

@github-actions
Copy link
Copy Markdown
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.54.0
jq 1.7
yq 4.53.2
curl 8.5.0
gh 2.92.0
node 24.16.0
python3 3.13.13
go 1.24.13
java 21.0.11
dotnet 10.0.300

Result: 12/12 tools available ✅

Overall Status: PASS

🔧 Tool validation by Agent Container Smoke Test · sonnet46 602.4K ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke test results: GitHub MCP ✅, Web Fetch ✅, File Write ✅, Bash ✅, Build ❌. Overall Status: FAIL.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

Smoke Gemini — Powered by Gemini ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test: Codex - 26672230016

  • ✅ GitHub PR read
  • ❌ Serena symbol search
  • ✅ Playwright
  • ❌ Web fetch
  • ✅ File writing
  • ✅ Bash verification
  • ✅ Build
  • ✅ Cache memory
  • ⚪ Comment memory skipped
  • ⚪ Set issue field skipped

Overall: FAIL

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex · gpt54 11.5M ·

@github-actions
Copy link
Copy Markdown
Contributor

🧪 Smoke Test: Claude — Run 26672230109

Core #1-13: ✅ all pass (Test 2 mcpscripts-gh ⚠️ tool unavailable → used github_pr_query)
PR Review #14-19: ✅ all pass
#20 close PR: ⚠️ skipped (no safe test PR)

Overall: PARTIALrun

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · opus48 1.1M ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 Automated smoke test review - all systems nominal!

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · opus48 1.1M

@@ -0,0 +1,5 @@
---
"gh-aw": patch
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke test review: changeset type is correctly set to patch. ✅

"gh-aw": patch
---

Fixed AWF chroot tool-cache mounting so runners that use `RUNNER_TOOL_CACHE` or the legacy `_tool` path can still find Node during startup.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke test review: clear description of the tool-cache mounting fix. 👍

@github-actions
Copy link
Copy Markdown
Contributor

[awf] Fix tool-cache mount handling, smoke-pi runtime config, and cache-memory git recovery
1✅ 2❌ 3✅ 4✅ 5❌ 6✅ 7✅ 8✅
9✅ 10✅ 11✅ 12✅ 13✅ 14❌ 15✅ 16✅
Overall: FAIL
Author: app/copilot-swe-agent | Assignees: @lpcox @Copilot

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · gpt54 18.2M ·

@pelikhan pelikhan merged commit 5f014f0 into main May 30, 2026
195 of 198 checks passed
@pelikhan pelikhan deleted the copilot/fix-nodejs-access-in-chroot branch May 30, 2026 02:56
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke review: the non-default tool-cache mount handling and cache-memory recovery changes look aligned with the added coverage.

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · gpt54 18.2M

toolCacheMountProbe := fmt.Sprintf(`%s=""
GH_AW_TOOL_CACHE="${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}"
if [ -d "$GH_AW_TOOL_CACHE" ]; then
if [[ "$GH_AW_TOOL_CACHE" != /opt/* ]]; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice guard on the extra mount. Restricting it to non-/opt tool-cache paths keeps the default hosted-runner case from picking up a redundant bind mount.

# If git metadata is malformed enough that config cannot be written (for example
# missing HEAD), recover by reinitializing while preserving working-tree files.
_hooks_config_err="$(mktemp)"
if ! git config core.hooksPath /dev/null 2>"$_hooks_config_err"; then
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good recovery ordering here: the hook-path write now happens behind a reinit path, so a missing HEAD can self-heal before git config turns the cache restore into a hard failure.

@github-actions
Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Copilot reports failed to deliver outputs. Our correspondents are investigating the incident...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[awf] Node.js not found in chroot when RUNNER_TOOL_CACHE is /home/runner/work/_tool

4 participants