Skip to content

fix: fallback to lowercase proxy env vars (http_proxy, https_proxy, no_proxy) - #767

Merged
fatelei merged 1 commit into
langgenius:mainfrom
isheng-eqi:fix/proxy-env-lowercase-fallback
Jul 6, 2026
Merged

fix: fallback to lowercase proxy env vars (http_proxy, https_proxy, no_proxy)#767
fatelei merged 1 commit into
langgenius:mainfrom
isheng-eqi:fix/proxy-env-lowercase-fallback

Conversation

@isheng-eqi

Copy link
Copy Markdown
Contributor

Summary

Fixes #18752

Problem

plugin_daemon only reads proxy environment variables in uppercase (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) via envconfig. In many Linux environments, these are conventionally set in lowercase (http_proxy, https_proxy, no_proxy). When users set only the lowercase variants, plugin_daemon ignores 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 to os.Getenv("http_proxy")
  • HttpsProxy → falls back to os.Getenv("https_proxy")
  • NoProxy → falls back to os.Getenv("no_proxy")

The uppercase envconfig binding 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 in SetDefault()

…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
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working plugin-daemon labels Jul 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 6, 2026
@fatelei
fatelei merged commit b4c7606 into langgenius:main Jul 6, 2026
7 checks passed
@isheng-eqi

Copy link
Copy Markdown
Contributor Author

感谢 @fatelei review 和合入!

简单介绍一下自己——我是太原理工大学(211)软件工程大二学生,专注 AI Agent 开发。之前做过几个相关项目:

  • Claude Code 全链路逆向(拆解 Agent Loop、System Prompt、60+ Tool Use 调度),编译了自己定制版
  • skill-builder-v3:自进化 Agent 技能引擎,MCP 协议集成
  • pure-chat:对接 14 家 LLM API,系统对比各模型行为差异

最近给 Dify 提了 6 个 PR(plugin-daemon 1 个 + 主仓库 5 个),逐渐熟悉了 daemon 和 Agent 相关模块。想问问团队是否招实习生?暑期可立即到岗。邮箱 [email protected],GitHub: isheng-eqi。期待有机会更深入参与!

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

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer plugin-daemon size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants