Skip to content

fix: align @npmcli/agent patch version with resolved lockfile#31362

Open
HrushiYadav wants to merge 1 commit into
anomalyco:devfrom
HrushiYadav:fix/npmcli-agent-patch-version
Open

fix: align @npmcli/agent patch version with resolved lockfile#31362
HrushiYadav wants to merge 1 commit into
anomalyco:devfrom
HrushiYadav:fix/npmcli-agent-patch-version

Conversation

@HrushiYadav
Copy link
Copy Markdown

@HrushiYadav HrushiYadav commented Jun 8, 2026

Issue for this PR

Closes #31319

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

patchedDependencies in package.json targets @npmcli/agent@4.0.0 but bun.lock resolves @4.0.2. Since the version doesn't match, the patch that calls .toString() on proxy.url is never applied. This causes fetch() proxy.url must be a non-empty string errors and hangs when HTTP_PROXY/HTTPS_PROXY are set.

Fix: bump the patch target from 4.0.0 to 4.0.2 and rename the patch file. The patched line in lib/agents.js is identical between both versions.

How did you verify your code works?

  • Compared lib/agents.js from both @npmcli/agent@4.0.0 and @4.0.2 via npm registry tarballs — the get proxy() getter is identical, patch applies cleanly
  • Confirmed the version mismatch by checking bun.lock resolves @4.0.2 while patchedDependencies targeted @4.0.0

Screenshots / recordings

N/A — not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

- patch was pinned to @4.0.0 but bun.lock resolves @4.0.2
- proxy.url .toString() fix was silently skipped, breaking plugin
  installs behind HTTP_PROXY/HTTPS_PROXY
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jun 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 8, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

plugin install can hang or hit proxy.url errors when HTTP_PROXY/HTTPS_PROXY are set

1 participant