Skip to content

feat(server): proxy support for assistant - #2687

Open
petertc (hrchu) wants to merge 2 commits into
browseros-ai:mainfrom
hrchu:feat/assistant-system-proxy
Open

petertc (hrchu) wants to merge 2 commits into
browseros-ai:mainfrom
hrchu:feat/assistant-system-proxy

Conversation

@hrchu

Copy link
Copy Markdown

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

  • New apps/server/src/lib/proxy/ module: env (HTTP(S)_PROXY/NO_PROXY) + Windows registry (manual entries and PAC via QuickJS evaluation) + macOS scutil fallback
  • All 14 providers in both pipelines (agent/provider-factory.ts, lib/clients/llm/provider.ts) now use the proxied fetch; localhost (Ollama/LMStudio) always bypasses; fails open to direct on any error
  • PAC DIRECT verdicts are final; only PAC failures fall back to the manual entry

Verification

  • 64 new unit tests; suites green: proxy 64, agent 209, lib 249, api 275
  • bun run check (lint+typecheck+fallow) clean; full bun test shows only the 108 pre-existing environmental failures, byte-identical on clean main
  • Proven live against local proxy/PAC servers (env, manual, and PAC paths)

Known limits

  • No proxy auth (out of scope for this change)
  • PAC SOCKS directives fall back; no multi-directive failover chain
  • PAC inside the compiled prod binary degrades until quickjs.wasm ships as a prod resource. New deps: pac-resolver, quickjs-wasi

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.
@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

@hrchu petertc (hrchu) changed the title feat(server): follow OS system proxy for assistant LLM traffic feat(server): proxy support for assistant Sep 16, 2026
@hrchu

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assistant ignores OS system proxy (manual/PAC) for LLM traffic

1 participant