fix(core): enable proxy local bypass from ENV vars#23380
fix(core): enable proxy local bypass from ENV vars#23380opposj wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello, 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 a critical issue where the application failed to bypass local services when operating behind a proxy, leading to connectivity problems for internal development or testing setups. By integrating Highlights
Using Gemini Code AssistThe 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
Customization To customize 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. 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
|
There was a problem hiding this comment.
Code Review
The pull request updates the setGlobalProxy function in packages/core/src/utils/fetch.ts to utilize EnvHttpProxyAgent from the undici library instead of ProxyAgent. This change involves importing EnvHttpProxyAgent and configuring it with httpProxy and httpsProxy properties, both set to the provided proxy string, while retaining the existing headersTimeout and bodyTimeout settings. This likely enhances proxy handling by allowing for environment variable-aware proxy configuration.
|
The code changes look solid. Switching from LGTM! Thank you for the contribution. |
|
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 have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. 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 and for being part of our community! |
Summary
This PR addresses the long-standing local service bypass issue mentioned earlier in #3340, which ensures that locally hosted services can be correctly bypassed via systematic
NO_PROXY/no_proxyenvironment variables when a proxy is enabled.Details
Thanks to the current global proxy design, it is convenient to realize this functionality. The only thing required is to replace the vanilla
ProxyAgentwithEnvHttpProxyAgent.WHAT is NOT changed:
proxyvariable, which is deemed to be of higher priority.no_proxystring for minimum modification that makes the proxy work naturally.Related Issues
Fixes #23372, Fixes #3340
Related to #6307, #4100
How to Validate
GOOGLE_GEMINI_BASE_URLto a locally hosted HTTP server using an addresshttp://127.0.0.1:4514.npm run build-and-start -- -p 'Hi!'to check whether the localhost service receives the request.Pre-Merge Checklist