Skip to content

Ensure Copilot bootstrap can find Node.js inside AWF chroot#2160

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/fix-copilot-cli-node-error
Draft

Ensure Copilot bootstrap can find Node.js inside AWF chroot#2160
Copilot wants to merge 5 commits intomainfrom
copilot/fix-copilot-cli-node-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Copilot-engine workflows were failing before inference because node was not available inside the chrooted agent environment (node: command not found). The failure path had no turns/tool calls, so startup needed a deterministic runtime fix and clearer diagnostics.

  • Node runtime visibility in chroot

    • Added ~/.nvm to agent bind mounts so nvm-managed Node installs are available in /host chroot.
    • Added ~/.nvm to pre-created allowed home subdirectories to avoid root-owned auto-created mount sources.
  • Fail-fast bootstrap guard for Copilot

    • Added AWF_REQUIRE_NODE signal in compose generation when the invoked executable is copilot (or Copilot auth env is configured).
    • Added an entrypoint preflight check gated by AWF_REQUIRE_NODE:
      • validates node is resolvable in chroot before running the user command
      • exits with a targeted, actionable error instead of a generic shell failure
  • Targeted test coverage

    • Extended docker-manager tests to validate:
      • .nvm mount inclusion
      • .nvm pre-creation
      • AWF_REQUIRE_NODE set for Copilot invocations and unset for non-Copilot commands
const commandExecutable = config.agentCommand.trim().split(/\s+/, 1)[0] || '';
const commandExecutableBase = path.posix.basename(commandExecutable.replace(/\\/g, '/'));
const isCopilotCommand = commandExecutableBase.toLowerCase() === 'copilot';
if (config.copilotGithubToken || config.copilotApiKey || isCopilotCommand) {
  environment.AWF_REQUIRE_NODE = '1';
}

Copilot AI changed the title [WIP] Fix Copilot CLI fails with node not found on runner bootstrap Ensure Copilot bootstrap can find Node.js inside AWF chroot Apr 23, 2026
Copilot AI requested a review from lpcox April 23, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[awf] Agent container: Copilot CLI fails with node: command not found on runner bootstrap

2 participants