-
Notifications
You must be signed in to change notification settings - Fork 1.2k
CLI Proxy Support #3024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
CLI Proxy Support #3024
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements CLI proxy support and fixes duplicated request handling between the CLI and extension. The changes include conditional model fetching to prevent unnecessary requests to unconfigured providers, proper message routing to avoid duplicates, and comprehensive proxy configuration supporting HTTP/HTTPS proxies with authentication, NO_PROXY patterns, and self-signed certificates.
Key Changes:
- Proxy Infrastructure: Added comprehensive proxy support with environment variable configuration, NO_PROXY pattern matching, and HTTP client integration
- Conditional Model Fetching: Modified webview message handler to only fetch models from providers with valid API keys or active configurations
- Message Handler Cleanup: Removed duplicate TUI message handlers and streamlined routing to prevent request duplication
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/core/webview/webviewMessageHandler.ts |
Refactored model fetching to be conditional based on provider configuration |
src/core/webview/__tests__/webviewMessageHandler.spec.ts |
Updated tests to reflect conditional model fetching behavior |
cli/src/utils/proxy-matcher.ts |
New utility for NO_PROXY pattern matching with wildcard and CIDR support |
cli/src/utils/proxy-config.ts |
New proxy configuration module supporting axios, fetch, and undici |
cli/src/ui/UI.tsx |
Fixed dependency array to prevent unnecessary re-renders |
cli/src/services/extension.ts |
Removed duplicate TUI request handler to fix message duplication |
cli/src/index.ts |
Added proxy configuration initialization at startup |
cli/src/host/ExtensionHost.ts |
Enhanced proxy setup and streamlined webview message handling |
cli/package.json |
Added proxy agent dependencies |
cli/package.dist.json |
Added proxy agent dependencies for distribution |
cli/esbuild.config.mjs |
Added proxy agents to external dependencies |
cli/README.md |
Added comprehensive proxy configuration documentation |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear to me why we'd want to implement proxy support in the CLI at this point, or why you decided to combine the duplicated request fix in the same PR.
Combined with the changes outside of the CLI folder, I'm inclined to say we don't want this and should instead look for other solutions. So can you maybe answer a couple of questions?
- Why did you combine the two fixes in one PR?
- Why do you think we need HTTP proxy support in the CLI?
- Why are there so many changes in the ClineProvider test file?
I Combined the duplicated calls with the proxy support because the proxy was essential to resolve the duplicated call issues and debug this type of request issues.
I reverted the changes of the Cline Provider, for fetch only the models for the providers that are configured. The changes of this PR only affect the CLI folder. |
Does the extension have proxy support? |
How does this work? Wouldn't the machine be set up to talk through a proxy? |
The proxies works on the application layer in general. For example. there are some companies/corporation that don't have access to internet on their offices, however some users have access to use a proxy for this, with a high regulated traffic log. |
based on GitHub sentiment it is spotty at best. |
Context
Resolve: #2971
Implementation
Screenshots
How to Test