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-13 16:32:04 -07:00
2026-04-21 05:52:46 -07:00
2026-02-02 19:01:51 -08:00
2026-04-17 20:25:48 -07:00
2026-04-21 00:50:58 -07:00
2026-04-13 16:32:04 -07:00
2026-04-14 10:52:23 -07:00
2026-03-29 10:19:54 -07:00
2026-03-25 15:02:03 -07:00
2026-04-06 16:49:54 -07:00
2026-04-10 21:18:34 -07:00
2026-04-21 01:56:35 -07:00
2026-04-20 11:53:07 -07:00
2026-04-21 00:54:46 -07:00
2026-04-21 00:43:50 -07:00
2026-03-25 15:02:03 -07:00
2026-04-19 01:51:12 -07:00