Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/kimi_cli/utils/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ def new_client_session(
return aiohttp.ClientSession(
connector=aiohttp.TCPConnector(ssl=_ssl_context),
timeout=timeout or _DEFAULT_TIMEOUT,
# Honour HTTP_PROXY/HTTPS_PROXY (and NO_PROXY) from the environment, like
# curl does. aiohttp ignores them unless trust_env is set.
trust_env=True,
)
10 changes: 10 additions & 0 deletions tests/utils/test_aiohttp_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ async def test_default_session_has_timeout():
assert session.timeout.sock_connect == 15


async def test_session_trusts_env_for_proxy():
"""new_client_session() must honour HTTP(S)_PROXY env vars (trust_env=True).

Without this, tools like FetchURL/WebSearch can't reach the network behind a
proxy even though curl can. See #2455.
"""
async with new_client_session() as session:
assert session.trust_env is True


async def test_custom_timeout_override():
"""Callers can override the default timeout."""
import aiohttp
Expand Down
Loading