Skip to content

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

@github-actions

Description

@github-actions

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions