unlinearity
155b619867
fix(agent): normalize socks:// env proxies for httpx/anthropic
WSL2 / Clash-style setups often export ALL_PROXY=socks://127.0.0.1:PORT. httpx and the Anthropic SDK reject that alias and expect socks5://, so agent startup failed early with "Unknown scheme for proxy URL" before any provider request could proceed.
Add shared normalize_proxy_url()/normalize_proxy_env_vars() helpers in utils.py and route all proxy entry points through them:
- run_agent._get_proxy_from_env
- agent.auxiliary_client._validate_proxy_env_urls
- agent.anthropic_adapter.build_anthropic_client
- gateway.platforms.base.resolve_proxy_url
Regression coverage:
- run_agent proxy env resolution
- auxiliary proxy env normalization
- gateway proxy URL resolution
Verified with:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 /home/nonlinear/.hermes/hermes-agent/venv/bin/pytest -o addopts='' -p pytest_asyncio.plugin tests/run_agent/test_create_openai_client_proxy_env.py tests/agent/test_proxy_and_url_validation.py tests/gateway/test_proxy_mode.py
39 passed.
2026-04-21 05:52:46 -07:00
..
2026-04-21 01:27:01 -07:00
2026-02-21 22:31:43 -08:00
2026-04-21 01:56:35 -07:00
2026-04-21 05:52:46 -07:00
2026-04-21 05:52:46 -07:00
2026-04-15 16:17:17 -07:00
2026-04-20 11:53:17 -07:00
2026-04-21 00:50:58 -07:00
2026-04-13 16:32:04 -07:00
2026-04-20 01:56:41 -07:00
2026-04-21 01:31:58 -07:00
2026-04-21 01:52:49 -07:00
2026-04-21 01:52:49 -07:00
2026-04-19 22:45:47 -07:00
2026-04-20 02:40:20 -07:00
2026-04-21 01:31:58 -07:00
2026-04-21 00:50:58 -07:00
2026-04-21 00:50:58 -07:00
2026-04-20 00:26:18 -07:00
2026-04-17 15:34:12 -07:00
2026-04-16 16:49:00 -07:00
2026-04-20 05:25:49 -07:00
2026-04-10 21:16:53 -07:00
2026-04-15 19:12:19 -07:00
2026-04-15 11:28:45 -07:00
2026-04-20 23:20:33 -07:00
2026-04-18 12:52:01 -07:00
2026-04-15 16:31:48 -07:00
2026-04-19 12:00:53 -07:00
2026-03-21 16:54:43 -07:00
2026-04-13 16:32:04 -07:00
2026-04-20 11:49:54 -07:00
2026-04-08 00:41:36 -07:00
2026-04-20 20:53:51 -07:00
2026-04-21 00:39:19 -07:00
2026-04-14 10:42:58 -07:00
2026-04-09 03:10:30 -07:00
2026-04-12 04:17:18 -07:00
2026-02-21 22:31:43 -08:00
2026-04-20 22:14:29 -07:00