change(llm): 出站代理留空=直连,不再回退 HTTP_PROXY 环境变量

- quotaAwareHTTPClient: proxy 为空时 transport.Proxy=nil(直连),
  不再用 http.ProxyFromEnvironment 吃 HTTP_PROXY/HTTPS_PROXY
- 前端代理输入:提示可带账号密码(socks5://user:pass@host:port),
  文案改为「留空表示不使用代理(直连)」

显式的 ARTEX_LLM_PROXY 环境变量不受影响(仍写入 Config.Proxy)。

Claude-Session: https://claude.ai/code/session_019QXSCDmzimwnjntBNCgUD7
This commit is contained in:
Autumn-27 committed 2026-08-23 10:41:16 -04:00
1 parent 52aba07846
commit 3297ca1821
2 files changed
+6 -5

No files matched your search

+4 -3
View File
@@ -31,8 +31,9 @@ type Config struct {
BaseURL string
APIKey string
Model string
// Proxy routes all LLM requests through the given proxy URL (http/https/socks5).
// Empty falls back to the standard *_PROXY environment variables.
// Proxy routes all LLM requests through the given proxy URL (http/https/socks5,
// optionally with user:pass@ credentials). Empty means direct — it does NOT
// fall back to the standard *_PROXY environment variables.
Proxy string
// RatePerSecond / RatePerMinute cap the shared request rate across ALL agents
// using the provider (0 = that window unlimited).
@@ -268,7 +269,7 @@ func quotaAwareHTTPClient(proxy string) (*http.Client, error) {
transport := http.DefaultTransport.(*http.Transport).Clone()
proxy = strings.TrimSpace(proxy)
if proxy == "" {
transport.Proxy = http.ProxyFromEnvironment
transport.Proxy = nil // 留空=直连,不回退 HTTP_PROXY/HTTPS_PROXY 环境变量
} else {
proxyURL, err := url.Parse(proxy)
if err != nil {