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 00:50:58 -07:00
2026-04-14 00:11:49 -07:00
2026-03-14 19:20:58 -07:00
2026-04-21 00:50:58 -07:00
2026-04-21 05:52:46 -07:00
2026-04-21 00:50:58 -07:00
2026-04-17 19:26:53 -07:00
2026-04-21 00:50:58 -07:00
2026-04-10 03:53:09 -07:00
2026-04-17 19:04:11 -07:00
2026-04-17 19:04:11 -07:00
2026-04-20 02:04:57 -07:00
2026-04-15 13:35:40 -07:00
2026-03-26 14:36:07 -07:00
2026-04-19 22:46:47 -07:00
2026-04-21 00:50:58 -07:00
2026-04-20 01:44:36 -07:00
2026-04-21 00:50:58 -07:00
2026-04-11 14:05:38 -07:00
2026-04-15 22:13:11 -07:00
2026-04-21 03:06:56 -07:00
2026-04-19 22:45:08 -07:00
2026-04-15 17:22:58 -07:00
2026-04-11 15:22:49 -07:00
2026-04-21 00:50:58 -07:00
2026-04-17 06:50:36 -07:00
2026-04-21 00:50:58 -07:00