feat(server): proxy support for assistant - #2687
Open
petertc (hrchu) wants to merge 2 commits into
Open
petertc (hrchu) wants to merge 2 commits into
petertc (hrchu) wants to merge 2 commits into
Conversation
Route all 14 assistant LLM providers through a proxy-aware fetch that honors HTTP(S)_PROXY/NO_PROXY plus the OS system setting: Windows registry (manual ProxyServer/ProxyOverride and AutoConfigURL PAC) and macOS scutil. Localhost targets always bypass so local Ollama/LMStudio servers stay direct. Fails open to direct on any resolution error.
Contributor
|
PR author is not in the allowed authors list. |
Contributor
|
All contributors have signed the CLA. Thank you! |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2686
Why
On corporate networks (notably Windows), the assistant server's LLM calls bypass the OS system proxy entirely — Bun/Node do not read the Windows registry (
ProxyServer/ProxyOverride/AutoConfigURL) or PAC configuration — so the agent cannot reach any provider. Related: #1240.What changed
apps/server/src/lib/proxy/module: env (HTTP(S)_PROXY/NO_PROXY) + Windows registry (manual entries and PAC via QuickJS evaluation) + macOSscutilfallbackagent/provider-factory.ts,lib/clients/llm/provider.ts) now use the proxied fetch; localhost (Ollama/LMStudio) always bypasses; fails open to direct on any errorDIRECTverdicts are final; only PAC failures fall back to the manual entryVerification
bun run check(lint+typecheck+fallow) clean; fullbun testshows only the 108 pre-existing environmental failures, byte-identical on clean mainKnown limits
SOCKSdirectives fall back; no multi-directive failover chainquickjs.wasmships as a prod resource. New deps:pac-resolver,quickjs-wasi