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-26 13:54:20 +03:00
2026-04-20 23:20:33 -07:00
2026-04-20 23:06:00 -07:00
2026-04-19 22:43:09 -07:00
2026-04-20 12:23:05 -07:00
2026-04-13 04:59:26 -07:00
2026-04-17 19:13:23 -07:00
2026-04-15 22:05:21 -07:00
2026-04-15 16:17:17 -07:00
2026-04-19 20:30:44 -07:00
2026-04-19 11:59:25 -07:00
2026-04-14 01:43:45 -07:00
2026-04-18 12:40:56 -07:00
2026-04-10 19:15:50 -07:00
2026-04-20 01:56:41 -07:00
2026-04-21 01:31:58 -07:00
2026-04-19 18:12:55 -07:00
2026-04-15 22:05:21 -07:00
2026-04-07 17:19:07 -07:00
2026-04-20 22:14:29 -07:00
2026-03-15 20:21:21 -07:00
2026-04-19 22:45:47 -07:00
2026-04-20 02:40:20 -07:00
2026-03-29 00:33:30 -07:00
2026-04-20 02:10:53 -07:00
2026-04-20 00:26:18 -07:00
2026-04-20 23:20:33 -07:00
2026-04-11 14:46:18 -07:00
2026-04-18 22:50:55 -07:00
2026-04-18 22:50:55 -07:00
2026-04-07 22:23:28 -07:00
2026-04-20 23:20:33 -07:00
2026-04-20 20:51:56 -07:00
2026-04-16 10:48:20 -07:00
2026-04-12 01:44:18 -07:00
2026-04-15 16:31:48 -07:00
2026-04-19 11:16:24 -07:00
2026-03-21 16:54:43 -07:00
2026-04-21 05:52:46 -07:00
2026-04-09 03:43:14 -07:00
2026-04-20 11:49:54 -07:00
2026-04-20 20:53:51 -07:00
2026-04-20 20:53:51 -07:00
2026-04-21 00:39:19 -07:00
2026-04-17 21:35:30 -07:00
2026-04-20 20:53:51 -07:00
2026-04-09 03:10:30 -07:00
2026-03-17 04:14:40 -07:00
2026-03-18 03:04:07 -07:00
2026-04-16 07:45:13 -07:00