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-07 17:19:07 -07:00
2026-04-17 14:21:22 -07:00
2026-04-17 14:21:22 -07:00
2026-04-17 12:32:03 -07:00
2026-04-17 12:32:03 -07:00
2026-04-10 13:38:14 -07:00
2026-04-07 17:19:07 -07:00
2026-04-07 17:19:07 -07:00
2026-04-07 17:19:07 -07:00
2026-04-19 11:23:00 -07:00
2026-04-19 22:43:09 -07:00
2026-04-19 22:43:09 -07:00
2026-04-19 22:43:09 -07:00
2026-04-15 13:16:28 -07:00
2026-04-07 17:19:07 -07:00
2026-04-20 00:56:04 -07:00
2026-04-17 12:32:03 -07:00
2026-04-20 05:12:10 -07:00
2026-04-07 17:19:07 -07:00
2026-04-19 12:39:58 -07:00
2026-04-19 11:23:00 -07:00
2026-04-17 12:32:03 -07:00
2026-04-21 05:52:46 -07:00
2026-04-17 12:32:03 -07:00
2026-04-13 10:50:24 -07:00
2026-04-17 14:21:22 -07:00
2026-04-17 14:21:22 -07:00
2026-04-08 18:55:33 -07:00
2026-04-07 17:19:07 -07:00
2026-04-20 23:20:33 -07:00
2026-04-15 22:05:21 -07:00
2026-04-07 17:19:07 -07:00
2026-04-18 22:50:55 -07:00
2026-04-07 17:19:07 -07:00
2026-04-10 03:44:43 -07:00
2026-04-17 12:32:03 -07:00
2026-04-10 03:21:24 -07:00
2026-04-20 21:02:28 -07:00
2026-04-17 12:32:03 -07:00
2026-04-20 12:23:05 -07:00
2026-04-13 10:50:24 -07:00
2026-04-07 17:19:07 -07:00
2026-04-20 05:12:55 -07:00
2026-04-17 14:21:22 -07:00
2026-04-20 04:16:13 -07:00
2026-04-21 05:32:27 -07:00
2026-04-16 16:36:33 -07:00
2026-04-07 17:19:07 -07:00
2026-04-07 17:19:07 -07:00
2026-04-20 22:18:49 -07:00
2026-04-19 19:18:19 -07:00
2026-04-07 17:19:07 -07:00
2026-04-10 05:52:45 -07:00
2026-04-17 12:32:03 -07:00
2026-04-07 17:19:07 -07:00
2026-04-15 15:03:28 -07:00