Describe the bug
When using Curator with the Anthropic SDK in a proxy environment (e.g. with HTTP_PROXY, HTTPS_PROXY, or ALL_PROXY set), Curator’s implementation bypasses the system proxy and connects directly to the Anthropic API.
To Reproduce
Steps to reproduce:
- Set proxy environment variables:
export HTTPS_PROXY=http://127.0.0.1:7890
export ANTHROPIC_API_KEY=sk-xxxxxx
-
Use Curator to make a call with a model such as "claude-3-5-sonnet-latest" (or any Anthropic model) behind the proxy.
-
Observe connection errors (timeout, unreachable host, proxy ignored).
Expected behavior
The Anthropic API client should route all requests through the configured system proxy when environment variables are set, so Curator works properly in proxy environments.
Root cause
- Curator’s integration uses
aiohttp to create the Anthropic client session, but it does not pass trust_env=True or forward proxy configuration to aiohttp.ClientSession. As a result, aiohttp bypasses the system proxy and connects directly to the Anthropic API even when HTTP(S)_PROXY or ALL_PROXY is set.
- According to the Anthropic SDK v0.54.0 release notes, the fix for proxy behavior was introduced in version 0.54.0 or higher.
Proposed fix for Curator
- When constructing the Anthropic client or
aiohttp.ClientSession, explicitly set trust_env=True (or equivalent) so that environment-defined proxies are respected.
- Update Curator’s dependency constraint for
anthropic to >= 0.54.0, which contains the upstream proxy fix in the SDK itself.
Environment
- Curator version: main branch (before fix)
- Python version: 3.10+
- OS: Linux
- Anthropic SDK version: < 0.54.0
- Proxy: HTTP(S) proxy set via environment variables
Additional context
A corresponding pull request has been opened to fix this issue and update the dependency. #698
Describe the bug
When using Curator with the Anthropic SDK in a proxy environment (e.g. with
HTTP_PROXY,HTTPS_PROXY, orALL_PROXYset), Curator’s implementation bypasses the system proxy and connects directly to the Anthropic API.To Reproduce
Steps to reproduce:
Use Curator to make a call with a model such as "claude-3-5-sonnet-latest" (or any Anthropic model) behind the proxy.
Observe connection errors (timeout, unreachable host, proxy ignored).
Expected behavior
The Anthropic API client should route all requests through the configured system proxy when environment variables are set, so Curator works properly in proxy environments.
Root cause
aiohttpto create the Anthropic client session, but it does not passtrust_env=Trueor forward proxy configuration toaiohttp.ClientSession. As a result,aiohttpbypasses the system proxy and connects directly to the Anthropic API even whenHTTP(S)_PROXYorALL_PROXYis set.Proposed fix for Curator
aiohttp.ClientSession, explicitly settrust_env=True(or equivalent) so that environment-defined proxies are respected.anthropicto >= 0.54.0, which contains the upstream proxy fix in the SDK itself.Environment
Additional context
A corresponding pull request has been opened to fix this issue and update the dependency. #698