Skip to content

fix: externalize https-proxy-agent in bundle - #26551

Closed
tejakusireddy wants to merge 1 commit into
google-gemini:mainfrom
tejakusireddy:fix-vertex-https-proxy-agent
Closed

fix: externalize https-proxy-agent in bundle#26551
tejakusireddy wants to merge 1 commit into
google-gemini:mainfrom
tejakusireddy:fix-vertex-https-proxy-agent

Conversation

@tejakusireddy

Copy link
Copy Markdown

Summary

Fixes #26533.

Externalizes https-proxy-agent from the main esbuild bundle so the Vertex AI / gaxios proxy path can load it through Node's runtime module resolver instead of using the bundled copy.

This avoids proxy-agent runtime failures when HTTP_PROXY / HTTPS_PROXY are set.

Details

The proxy path in gaxios lazily imports https-proxy-agent. When bundled into the CLI output, that dependency can hit bundling/runtime interop problems. Keeping it external preserves the package's normal runtime export shape.

This PR also adds https-proxy-agent to the root runtime dependencies so the published CLI package can resolve the externalized import after installation.

Related Issues

Fixes #26533

How to Validate

  • npx prettier --check esbuild.config.js package.json package-lock.json
  • npm run bundle
  • npm pack
  • Installed the packed tarball into a clean temp project
  • Verified require.resolve('https-proxy-agent') succeeds from the clean installed package
  • npm run preflight
  • git diff --check

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any) — no breaking changes
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@tejakusireddy
tejakusireddy requested review from a team as code owners May 5, 2026 23:23
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses runtime proxy failures by externalizing the 'https-proxy-agent' package from the main esbuild bundle. By allowing the package to be resolved via Node's native module resolver, it ensures compatibility with Vertex AI and gaxios proxy paths, resolving issues encountered when environment proxy variables are set.

Highlights

  • Externalize https-proxy-agent: Added 'https-proxy-agent' to the esbuild external configuration to prevent bundling issues.
  • Dependency Management: Added 'https-proxy-agent' to the root package.json and package-lock.json to ensure it is available as a runtime dependency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@google-cla

google-cla Bot commented May 5, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the https-proxy-agent dependency to the project, updating both package.json and package-lock.json. Additionally, it marks https-proxy-agent as an external dependency in the esbuild.config.js file. There are no review comments to address, and I have no further feedback to provide.

Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request May 6, 2026
gemini-cli/qwen-code/crush/goose coverage:
- google-gemini/gemini-cli#26551 externalize https-proxy-agent (man)
- QwenLM/qwen-code#3865 persist channel sessions across restarts (man)
- charmbracelet/crush#2807 oauth refresh in summarize path (man)
- aaif-goose/goose#9047 settings moved into app shell with URL state (man)
@gemini-cli gemini-cli Bot added priority/p1 Important and should be addressed in the near term. area/core Issues related to User Interface, OS Support, Core Functionality labels May 7, 2026
@gemini-cli

gemini-cli Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Hi there! Thank you for your interest in contributing to Gemini CLI.

To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'.

This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding.

@gemini-cli

gemini-cli Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality priority/p1 Important and should be addressed in the near term. size/xs An extra small PR status/pr-nudge-sent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: "HttpsProxyAgent is not a constructor" crash when using Vertex AI with HTTP_PROXY environment variables

2 participants