Skip to content

fix(proxy): hint for corporate firewalls where DeepSeek requires proxy (#2215)#2229

Merged
esengine merged 1 commit into
esengine:mainfrom
nianyi778:fix/proxy-deepseek-direct-hint
May 29, 2026
Merged

fix(proxy): hint for corporate firewalls where DeepSeek requires proxy (#2215)#2229
esengine merged 1 commit into
esengine:mainfrom
nianyi778:fix/proxy-deepseek-direct-hint

Conversation

@nianyi778

Copy link
Copy Markdown

问题

关闭 #2215。企业内网用户设置了 HTTPS_PROXY 但连接 DeepSeek API 仍然失败(fetch failed),错误信息中可以看到 NO_PROXY: api.deepseek.com

根因:为了防止 clash/v2ray 用户的代理出口 IP 被 DeepSeek 403,代码默认把 api.deepseek.com 加进 NO_PROXY(bypass 直连)。但企业防火墙环境恰好相反——必须通过代理才能访问 deepseek,直连反而不通。

解决方案其实早就有了(REASONIX_PROXY_DEEPSEEK_DIRECT=0 或 config bypassDeepSeekDirect:false,见 #1497),但 stderr 日志里完全没有提示,用户无从得知。

修改

[proxy] 日志中补一行提示,当 api.deepseek.com 走直连时告知用户可以关闭这个行为:

[proxy] using http://proxy:7853 (source: env, NO_PROXY: api.deepseek.com,...)
[proxy] api.deepseek.com is bypassed (direct). If your firewall blocks direct
        egress, set REASONIX_PROXY_DEEPSEEK_DIRECT=0 or add
        "proxy":{"bypassDeepSeekDirect":false} to ~/.reasonix/config.json

只改了一处: 的 函数,在 bypass 生效时打印这条提示。不影响任何行为。

esengine#2215)

By default api.deepseek.com is in NO_PROXY so clash/v2ray users avoid 403s
from shared exit IPs. Corporate users whose firewall blocks direct egress get
a silent 'fetch failed' with no guidance.

Add a stderr hint when api.deepseek.com is bypassed, pointing users to
REASONIX_PROXY_DEEPSEEK_DIRECT=0 or bypassDeepSeekDirect:false in config.
@nianyi778

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Helpful diagnostic — when api.deepseek.com is bypassed (direct egress), prints a one-line stderr hint that enterprise users behind a firewall can flip REASONIX_PROXY_DEEPSEEK_DIRECT=0 / proxy.bypassDeepSeekDirect:false. Reuses the existing resolveBypassDeepSeekDirect resolution, no behavior change beyond the message. CI green. Merging.

@esengine esengine merged commit 991ad37 into esengine:main May 29, 2026
4 checks passed
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.

2 participants