fix: fallback to lowercase proxy env vars (http_proxy, https_proxy, no_proxy) - #767
Conversation
…o_proxy) Currently plugin_daemon only reads HTTP_PROXY/HTTPS_PROXY/NO_PROXY in uppercase via envconfig. Many Linux environments set these in lowercase (http_proxy/https_proxy/no_proxy), causing plugin installation failures behind proxies. This adds a fallback in SetDefault() that reads lowercase variants when the uppercase ones are empty. Fixes #18752
There was a problem hiding this comment.
Code Review
This pull request updates the configuration initialization in internal/types/app/default.go to fall back to lowercase proxy environment variables (http_proxy, https_proxy, and no_proxy) if the uppercase configuration values are not set. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
感谢 @fatelei review 和合入! 简单介绍一下自己——我是太原理工大学(211)软件工程大二学生,专注 AI Agent 开发。之前做过几个相关项目:
最近给 Dify 提了 6 个 PR(plugin-daemon 1 个 + 主仓库 5 个),逐渐熟悉了 daemon 和 Agent 相关模块。想问问团队是否招实习生?暑期可立即到岗。邮箱 [email protected],GitHub: isheng-eqi。期待有机会更深入参与! |
Summary
Fixes #18752
Problem
plugin_daemononly reads proxy environment variables in uppercase (HTTP_PROXY,HTTPS_PROXY,NO_PROXY) viaenvconfig. In many Linux environments, these are conventionally set in lowercase (http_proxy,https_proxy,no_proxy). When users set only the lowercase variants,plugin_daemonignores them, leading to nil pointer dereference when trying to use the empty proxy values.Fix
Added fallback logic in
Config.SetDefault()that reads lowercase environment variables when the uppercase ones are empty:HttpProxy→ falls back toos.Getenv("http_proxy")HttpsProxy→ falls back toos.Getenv("https_proxy")NoProxy→ falls back toos.Getenv("no_proxy")The uppercase
envconfigbinding takes priority; lowercase is only used as a fallback when uppercase is empty. This maintains backward compatibility while supporting the common lowercase convention.Changes
internal/types/app/default.go: Added"os"import and fallback logic inSetDefault()