Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

FetchURL 未读取系统代理,在被墙环境下无法访问外网,而 Shell/curl 正常 || FetchURL has not read the system proxy and cannot access the external network in a blocked environment, but Shell/curl is normal #2455

Description

@KuangYin-Z

What version of Kimi Code CLI is running?

kimi, version 1.43.0

Which open platform/subscription were you using?

managed:kimi-code(Kimi Code 账号登录)

Which model were you using?

K2.7 Code (kimi-for-coding)

What platform is your computer?

Linux 6.18.33.1-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

在存在 GFW 的网络环境下,系统代理已正确配置,Shell 中的 curl 可以正常访问 YouTube/Google,但 FetchURL 工具会失败。

Shell 环境变量:

HTTP_PROXY=http://127.0.0.1:7890
HTTPS_PROXY=http://127.0.0.1:7890
http_proxy=http://127.0.0.1:7890
https_proxy=http://127.0.0.1:7890
curl 测试通过:

curl -I https://www.youtube.com # 200 OK
curl -I https://www.google.com # 200 OK
但 FetchURL 访问同样的 URL 会失败。

~/.kimi/logs/kimi.log 中的相关日志:

kimi_cli.tools.web.fetch:_fetch_with_service:158 - FetchURL service HTTP error: status=403, url=https://www.youtube.com
kimi_cli.tools.web.fetch:fetch_with_http_get:87 - FetchURL network error: Cannot connect to host www.youtube.com:443 ssl:default [Connection reset by peer], url=https://www.youtube.com
kimi_cli.tools.web.fetch:_fetch_with_service:158 - FetchURL service HTTP error: status=403, url=https://www.google.com
kimi_cli.tools.web.fetch:fetch_with_http_get:87 - FetchURL network error: Cannot connect to host www.google.com:443 ssl:default [Connection reset by peer], url=https://www.google.com
另外,执行 curl --noproxy "*" 会返回 Connection reset by peer,说明直连确实被墙,只有走代理才能访问。

What steps can reproduce the bug?

1.配置本地 HTTP 代理,并导出 HTTP_PROXY/HTTPS_PROXY。

2.执行:
curl -I https://www.youtube.com
curl -I https://www.google.com
结果正常(200 OK)。

3.在同一会话中,使用 FetchURL 工具访问 https://www.youtube.com 和 https://www.google.com。

4.观察到失败:Connection reset by peer。

What is the expected behavior?

FetchURL 应该读取 HTTP_PROXY/HTTPS_PROXY 环境变量,或者支持在 ~/.kimi/config.toml 中配置代理,从而像 curl 一样正常访问外网。

Additional information

当前临时 workaround:用 Shell 工具执行 curl/wget 代替 FetchURL。

本地代理为 Clash Verge 的 HTTP 代理,地址是 127.0.0.1:7890。


What version of Kimi Code CLI is running?

kimi, version 1.43.0

Which open platform/subscription were you using?

managed:kimi-code (Kimi Code account login)

Which model were you using?

K2.7 Code (kimi-for-coding)

What platform is your computer?

Linux 6.18.33.1-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

In a network environment with GFW, the system proxy has been configured correctly, and curl in the Shell can access YouTube/Google normally, but the FetchURL tool will fail.

Shell environment variables:

HTTP_PROXY=http://127.0.0.1:7890
HTTPS_PROXY=http://127.0.0.1:7890
http_proxy=http://127.0.0.1:7890
https_proxy=http://127.0.0.1:7890
The curl test passes:

curl -I https://www.youtube.com # 200 OK
curl -I https://www.google.com # 200 OK
But FetchURL will fail when accessing the same URL.

Relevant logs in ~/.kimi/logs/kimi.log:

kimi_cli.tools.web.fetch:_fetch_with_service:158 - FetchURL service HTTP error: status=403, url=https://www.youtube.com
kimi_cli.tools.web.fetch:fetch_with_http_get:87 - FetchURL network error: Cannot connect to host www.youtube.com:443 ssl:default [Connection reset by peer], url=https://www.youtube.com
kimi_cli.tools.web.fetch:_fetch_with_service:158 - FetchURL service HTTP error: status=403, url=https://www.google.com
kimi_cli.tools.web.fetch:fetch_with_http_get:87 - FetchURL network error: Cannot connect to host www.google.com:443 ssl:default [Connection reset by peer], url=https://www.google.com
In addition, executing curl --noproxy "*" will return Connection reset by peer, indicating that the direct connection is indeed blocked and can only be accessed through a proxy.

What steps can reproduce the bug?

  1. Configure the local HTTP proxy and export HTTP_PROXY/HTTPS_PROXY.

  2. Execution:
    curl -I https://www.youtube.com
    curl -I https://www.google.com
    The result is normal (200 OK).

  3. In the same session, use the FetchURL tool to visit https://www.youtube.com and https://www.google.com.

  4. Failure observed: Connection reset by peer.

What is the expected behavior?

FetchURL should read the HTTP_PROXY/HTTPS_PROXY environment variable, or support configuring the proxy in ~/.kimi/config.toml to access the external network normally like curl.

Additional information

Current temporary workaround: Use shell tool to execute curl/wget instead of FetchURL.

The local proxy is Clash Verge’s HTTP proxy at 127.0.0.1:7890.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions