Repository navigation
Bootstrap pnpm via a registry-honoring fallback when corepack can't reach its metadata endpoint - #1374
Merged
Cedric Vidal (cedricvidal) merged 2 commits intoJul 31, 2026
Conversation
Follow-up to #1373. That change forwards the host npm registry into the
image builds, but the pnpm bootstrap still fails on networks with no
route to the public registry, because:
* corepack resolves the package manager from its own per-version
metadata endpoint (`${registry}/pnpm/<version>`). Some private
registry proxies serve the full packument (`${registry}/pnpm`) but
return 404 for the per-version document, so corepack errors out.
* the `NPM_CONFIG_REGISTRY` ARG/ENV were placed *after* the corepack
step, so `npm_config_registry` was not yet in effect during bootstrap.
Move the ARG/ENV ahead of the corepack step, also export
`COREPACK_NPM_REGISTRY` (the variable corepack honors), and fall back to a
pinned `npm install -g [email protected] --force` when corepack cannot reach
its metadata endpoint. `--force` is required because `corepack enable`
has already planted a pnpm shim at that path.
The default remains the public registry, so external contributors and CI
are unaffected: corepack succeeds and the fallback never runs. The
fallback installs the same pinned pnpm version via the standard packument
endpoint, which proxies do serve.
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 7f3fabf3-4153-4af7-8b1f-daf6b83f93ca
Test Results (Node.js 22)test: Run #30
🎉 All tests passed! |
Cedric Vidal (cedricvidal)
added a commit
that referenced
this pull request
Oct 8, 2026
Resolve conflicts with main (#1379, #1373/#1374, #1381, #1385): - Port main's ACP worker logic into the reusable worker.ts; keep index.ts thin - Use main's agent-registry admission; keep host checks for resume/bulk-resume - Pin SCOPE_AGENT_VERSION for host and Docker workers to the registered version - CLI api-client: main's auth + environment-aware client; SSE sends auth - Drop Foundry proxy (superseded by #1379) and .scope Dockerfile rewrite - Regenerate pnpm-lock.yaml and OpenAPI snapshot Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to #1373. That PR forwards the host npm registry into the image builds via
NPM_CONFIG_REGISTRY, but the pnpm bootstrap still fails on networks that have no route to the public npm registry, for two reasons:npm_config_registry. It resolves the package manager from its own per-version metadata endpoint,${registry}/pnpm/<version>. Some private registry proxies serve the full packument (${registry}/pnpm→ 200) but return 404 for that per-version document, socorepack prepareerrors out (request to …/pnpm/10.29.1 … 404).NPM_CONFIG_REGISTRYARG/ENVafter thecorepack prepareline, sonpm_config_registrywasn't even in effect during bootstrap.Fix
Applied uniformly to all 12 Node Dockerfiles (20 build stages):
ARG/ENVbefore the corepack step.COREPACK_NPM_REGISTRY(the variable corepack honors) so it succeeds on proxies that do serve per-version metadata, and fails fast otherwise.npm install -g [email protected] --forcewhen corepack can't reach its endpoint. Plainnpmuses the full packument, which proxies do serve.--forceis required becausecorepack enablehas already planted a pnpm shim at/usr/local/bin/pnpm(otherwise npm fails withEEXIST).Impact
The default stays the public registry, so external contributors and CI are unaffected — corepack succeeds and the fallback never runs. The fallback only fires on restricted networks and installs the same pinned pnpm version.
Validation
node:22.22.0-slimcontainers against a private proxy.apiimage standalone (corepack 404 →npm install -g … --force→pnpm installpulled all deps via the proxy → build succeeded).docker compose … up --build -dof the dev stack behind the proxy: all services built and came up healthy.