Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

The PATH setup for agent containers only exposed Node.js binaries from /opt/hostedtoolcache. Claude and Codex engines used a Node-specific find command while Copilot already used a more general approach.

Changes

  • Shared helper: Added GetHostedToolcachePathSetup() in engine_helpers.go returning a unified PATH setup command
  • Claude/Codex engines: Replaced Node-specific PATH setup with the shared helper
  • Copilot engine: Refactored to use shared helper for consistency
  • Tests: Added tests for the new helper function

PATH Setup

Before (Claude/Codex - Node only):

NODE_BIN_PATH="$(find /opt/hostedtoolcache/node -mindepth 1 -maxdepth 1 -type d | head -1 | xargs basename)/x64/bin"
export PATH="/opt/hostedtoolcache/node/$NODE_BIN_PATH:$PATH"

After (all engines - all runtimes):

export PATH="$(find /opt/hostedtoolcache -maxdepth 4 -type d -name bin 2>/dev/null | tr '\n' ':')$PATH"

This adds all runtime binaries to PATH matching the hostedtoolcache structure: /opt/hostedtoolcache/<tool>/<version>/<arch>/bin (node, Python, go, Ruby, etc.).

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Expand /opt/hostedtoolcache PATH integration for Python and other runtimes</issue_title>
<issue_description>## Objective

Improve the PATH setup for the agent container to expose Python, Ruby, Go, and other runtime tools installed in /opt/hostedtoolcache, not just Node.js.

Context

The /opt/hostedtoolcache directory is already mounted into the agent container, but the PATH setup currently only handles Node.js binaries. The Ubuntu runner image includes Python (3.9-3.14), Ruby (3.2-3.4), Go (1.22-1.25), and other runtimes in this directory.

Current PATH setup examples:

  • Copilot engine: find /opt/hostedtoolcache -maxdepth 4 -type d -name bin
  • Claude/Codex engines: find /opt/hostedtoolcache/node (Node-specific)

Approach

  1. Review how GitHub Actions runners organize tools in /opt/hostedtoolcache:
    • Structure: /opt/hostedtoolcache/(tool)/(version)/(arch)/bin
    • Common tools: node, python, go, ruby, pypy, java
  2. Enhance the PATH setup command to include all runtime binaries:
    export PATH="$(find /opt/hostedtoolcache -maxdepth 4 -type d -name bin 2>/dev/null | tr '\n' ':')$PATH"
  3. Update the PATH setup in all three engine implementations
  4. Add logic to prioritize certain versions when multiple are available
  5. Test that Python, Ruby, Go, and Node.js are all accessible from the agent container

Files to Modify

  • Modify: pkg/workflow/copilot_engine_execution.go (line ~360: enhance PATH setup)
  • Modify: pkg/workflow/claude_engine.go (line ~247: replace Node-specific setup)
  • Modify: pkg/workflow/codex_engine.go (line ~294: replace Node-specific setup)
  • Create: pkg/workflow/runtime_path_test.go (test runtime detection)

Acceptance Criteria

  • All cached runtimes (Node.js, Python, Ruby, Go) are accessible via PATH
  • PATH setup works consistently across all engine types
  • Tests verify that node, python3, ruby, go commands are available
  • Version selection logic handles multiple installed versions gracefully
  • Documentation explains how runtime selection works
    Related to epic: build/test environment for agentic workflow #11970

AI generated by Plan Command for #11970

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Changeset

  • Type: patch
  • Description: Added a shared hostedtoolcache PATH helper so all engines expose every cached runtime's binaries.

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
- Create shared GetHostedToolcachePathSetup() helper in engine_helpers.go
- Update claude_engine.go to use unified PATH setup (not just Node.js)
- Update codex_engine.go to use unified PATH setup (not just Node.js)
- Update copilot_engine_execution.go to use shared helper for consistency
- Add tests for GetHostedToolcachePathSetup in engine_helpers_test.go

The new PATH setup finds all bin directories in /opt/hostedtoolcache,
making Python, Go, Ruby, and other runtimes accessible in agent containers.

Fixes #12033

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve PATH setup for hostedtoolcache integration Expand hostedtoolcache PATH integration for Python and other runtimes Jan 27, 2026
Copilot AI requested a review from Mossaka January 27, 2026 00:38
Mossaka and others added 2 commits January 27, 2026 17:17
…toolcache-path

# Conflicts:
#	.github/workflows/jsweep.lock.yml
#	.github/workflows/smoke-claude.lock.yml
#	.github/workflows/smoke-codex.lock.yml
#	.github/workflows/smoke-copilot.lock.yml
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Mossaka Mossaka added the smoke label Jan 27, 2026
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

🌑 The shadows whisper... Smoke Codex was cancelled. The oracle requires further meditation...

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

💀 Blimey! Changeset Generator was cancelled and walked the plank! No treasure today, matey! ☠️

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

💫 TO BE CONTINUED... Smoke Claude was cancelled! Our hero faces unexpected challenges...

@Mossaka Mossaka added smoke and removed smoke labels Jan 27, 2026
@github-actions
Copy link
Contributor

📰 DEVELOPING STORY: Smoke Copilot reports was cancelled. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

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

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

🎭 The Copilot smoke test agent just breezed through town! 🌪️

All systems are running smooth as silk – GitHub MCP queries are flowing, Serena's activated, Playwright's dancing through web pages, and files are being written and read like poetry. The smoke test agent was here, it conquered, and now it's off to smoke-test another day! 💨✨

Stay awesome, gh-aw team! 🚀

Smoke test run: §21407113629

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

Smoke Test Results ✅

Last 2 Merged PRs:

Test Results:

  • ✅ GitHub MCP Testing
  • ✅ Safe Inputs GH CLI Testing
  • ✅ Serena MCP Testing
  • ✅ Playwright Testing
  • ✅ File Writing Testing
  • ✅ Bash Tool Testing
  • ✅ Discussion Interaction Testing

Overall Status: PASS ✅

cc @Mossaka @Copilot

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

GitHub MCP merged PRs: ✅ Fix AWF command quoting to ensure agent runs inside firewall container; ✅ Add project frontmatter field for automatic project board tracking
safeinputs-gh PR list: ✅ [WIP] Fix test failures when running make test; ✅ Enable campaign orchestrator generation via project field detection
Serena activate: ✅
Playwright github.com title: ✅
Tavily search: ✅
File write: ✅
Bash cat: ✅
Discussion query + comment: ✅
Overall status: PASS

AI generated by Smoke Codex

@github-actions
Copy link
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

Smoke Test: Claude - 21407113647

Last 2 Merged PRs:

Test Results:
✅ GitHub MCP
✅ Safe Inputs GH CLI
✅ Serena MCP
✅ Make Build
✅ Playwright
✅ Tavily Web Search
✅ File Writing
✅ Bash Tool
✅ Discussion Interaction

Status: PASS ✅

AI generated by Smoke Claude

@Mossaka Mossaka marked this pull request as ready for review January 27, 2026 17:33
@Mossaka Mossaka merged commit ce40c79 into main Jan 27, 2026
141 of 156 checks passed
@Mossaka Mossaka deleted the copilot/expand-hostedtoolcache-path branch January 27, 2026 17:34
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.

[plan] Expand /opt/hostedtoolcache PATH integration for Python and other runtimes

2 participants