fix: respect NO_PROXY environment variable for proxy bypass#2205
fix: respect NO_PROXY environment variable for proxy bypass#2205tanzhenxin wants to merge 2 commits intomainfrom
Conversation
Add support for NO_PROXY/no_proxy environment variable to allow bypassing proxy for specified hosts. This fixes connection issues in corporate environments where internal LLM servers should not go through the proxy. Changes: - runtimeFetchOptions.ts: Pass noProxy option to ProxyAgent - config.ts: Pass noProxy option to setGlobalDispatcher ProxyAgent - runtimeFetchOptions.test.ts: Add tests for NO_PROXY handling Fixes #756, #1333 Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
📋 Review SummaryThis PR adds support for the 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
On Windows, environment variables are case-insensitive, so setting both NO_PROXY and no_proxy causes them to overwrite each other. Simplified the test to only set one variable to ensure cross-platform compatibility. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
TLDR
This PR adds support for the NO_PROXY/no_proxy environment variable, allowing Qwen Code to bypass the proxy for specified hosts. This fixes connection issues in corporate environments where internal LLM servers should not go through the proxy.
Dive Deeper
The undici ProxyAgent used by Qwen Code does not automatically read NO_PROXY from environment variables (unlike EnvHttpProxyAgent). This caused all HTTP requests to go through the proxy, even for hosts explicitly listed in NO_PROXY.
Changes made:
Reviewer Test Plan
Manual testing in a corporate environment with proxy:
Testing Matrix
Linked issues / bugs
Fixes #756
Fixes #1333
🤖 Generated with Qwen Code