What the agent does
Two different bugs print this message, and the traceback's last frame tells them apart, so the agent reads that before anything else. Either the project's own code calls httpx.Client(proxies=...), or an older SDK does it internally. In finaldie/auto-news it is the project. Three places build a client that way: line 198 of src/llm_agent.py, line 22 of src/embedding_openai_1x.py and line 38 of src/embedding_openai_0x.py. Each sits under if os.getenv('OPENAI_PROXY') is not None, and .env.template ships that variable commented out. Meanwhile pyproject.toml lists "httpx" and docker/requirements.txt lists httpx[socks], neither with a version, and the image installs them with pip install --no-cache-dir -r requirements.txt. So a rebuilt image gets a new httpx, most deployments notice nothing, and the ones behind a corporate proxy fail on their first model call.
The agent pins down the versions by running them. On httpx 0.27.2 the dictionary form works and warns: The 'proxies' argument is now deprecated. Use 'proxy' or 'mounts' instead. On 0.28.1, the first release line without it, the constructor raises the error in the title. The replacement keyword has a floor of its own: httpx.Client(proxy=...) is accepted by 0.26.0 and refused by 0.25.2 with the mirror-image TypeError about proxy. Since both keys of the project's dictionary hold the same URL, the single proxy= argument expresses the same thing, and the agent adds httpx>=0.26 to both dependency files so the fix cannot be installed beside a release that rejects it.
Then it checks behaviour instead of trusting the rename. It starts a small recording proxy on localhost in the sandbox, a few lines of socket code that log the first line of every connection, and sends a plain and a TLS request through each client. The old form on 0.27.2 and the new form on 0.28.1 produce the same log: an absolute-URL GET for the plain request and a CONNECT host:443 for the TLS one. It repeats the test with the OpenAI SDK the way the fixture uses it, OpenAI(http_client=client), and the proxy records CONNECT api.openai.com:443. No key is needed and nothing leaves the sandbox, because the stand-in proxy refuses the tunnel.
Two findings go in the pull request besides the edit. An explicit proxy= ignores the NO_PROXY environment variable: with it set to the target host the request still goes to the proxy, while a client built with no arguments and HTTP_PROXY in the environment honours it. That is true of the old code too, so the agent documents it and does not change it. And it shows the other bug for comparison. With openai 1.54.0 and httpx 0.28.1, a bare OpenAI() raises the same message from inside the SDK's _base_client.py; there the fix is an SDK upgrade, and editing application code does nothing. The fixture leaves openai unpinned, so a fresh install is not affected, and the agent says how it checked.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "This project fails with \"TypeError: Client.__init__() got an unexpected keyword argument 'proxies'\" when a proxy is configured. First decide whose call it is: search the project for proxies= passed to httpx.Client, httpx.AsyncClient or top-level httpx functions, and separately check whether any installed SDK passes it internally by constructing each SDK client the project uses with no proxy on the newest httpx. List every call site with file, line and the condition under which it runs, including environment variables, and say what the dependency files pin. Reproduce on two httpx versions: the last one that accepts proxies (show the deprecation warning) and the newest (show the TypeError). Replace each call with proxy= when all schemes use one URL, or with mounts= and one transport per scheme when they differ, and find by testing the oldest httpx release that accepts your replacement; set that as a lower bound wherever httpx is declared. Prove the behaviour is unchanged without contacting any real service: run a minimal recording proxy on localhost, send one http and one https request through the old code on the old httpx and the new code on the newest httpx, and compare what the proxy logged. Do the same through each SDK client the project hands its httpx client to. Report how NO_PROXY and the HTTP_PROXY variables interact with the explicit proxy before and after, without changing that behaviour. If an SDK is the caller, upgrade it to the first release that works and show the before and after. Open a pull request with the logs.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
A pull request that changes three constructor calls and two dependency lines. The description begins with the answer to whose call it was, with the frame from the traceback, and a table of the three sites and the environment variable that guards them. Below that are the two reproductions with their exact messages, the result of the floor test for proxy=, and the recording proxy's log for each combination. The note about NO_PROXY and the comparison with an old SDK are marked as observations, not changes.
The reviewer's check is that the logs match line for line between old and new, for plain and TLS requests, and that the lower bound appears in both pyproject.toml and docker/requirements.txt, since the image installs from the second. If the team routes some hosts around the proxy, the NO_PROXY note tells them the explicit client never did that. The agent has neither the real proxy nor a key for the model provider in the sandbox, and the pull request says the end-to-end call through production infrastructure is still to be confirmed after deploy.
Run it on every error tracker issue
Only installations with a proxy configured raise this, so it tends to arrive as one customer's or one region's error after an image rebuild. Most error trackers sign their webhook deliveries themselves and cannot add the Authorization: Bearer header a Rush webhook trigger needs, so a handler on your server receives the tracker's event, keeps those whose message contains unexpected keyword argument 'proxies', and posts the traceback to the trigger's URL with the trigger's secret. The traceback is what the agent needs most, because its last frame says whether the caller is your code or a library.
The same deployment will raise the error on every call until it is fixed. Have the handler send an Idempotency-Key header to the trigger's URL, built from the tracker's issue id, so repeats start nothing new, and set the automation's max runs per hour low.
The use case this job follows, with its automation and trigger: Fix a bug from an alert.
Why run it on Rush?
A proxy bug is awkward to reproduce at a desk. The developer's machine usually has no proxy, the variable that enables the code path is unset, and the environment already holds whichever httpx was installed months ago. In a Rush sandbox the agent builds one environment per httpx version, sets the variable, runs its own recording proxy, and keeps every command and log line in the session. The branch that only some deployments take gets exercised on purpose.
The run also settles the question that wastes the most time with this message: whether to edit code or upgrade a package. Advice found by searching the error text is split between the two because both causes exist. Constructing each client in a clean environment and reading the failing frame answers it for this repository, and the pull request shows the evidence for the path not taken as well.
Frequently asked questions
What replaces the proxies argument in httpx?
proxy= with a single URL when every scheme uses the same proxy, or mounts= with an httpx.HTTPTransport(proxy=...) per scheme when they differ. httpx 0.27 accepted the old argument with a deprecation warning that names both, and 0.28 removed it.
I never pass proxies. Why do I get this error?
A library you use does. Older releases of some SDKs built their httpx client with proxies, and they break on httpx 0.28 even with no proxy configured. The agent constructs each SDK client in a clean environment to find which one, then upgrades it or, if no fixed release exists, pins httpx below 0.28 with the reason.
Should I pin httpx below 0.28 instead?
It works as a stopgap and is the right call when the failing code belongs to a dependency you cannot upgrade yet. For your own code the rename is small and proxy= is accepted from 0.26.0, so the fix does not force the newest httpx on anyone.
Does the agent need my proxy or API keys?
No. It tests against a recording proxy it runs inside the sandbox and uses a placeholder key, because the check is which host the client tries to reach and how, and the request never gets past the stand-in. Confirming the real route is a step for after the deploy.
More jobs like this: Fix a bug from an alert
- Fix "husky - install command is DEPRECATED" and the husky.sh deprecation in husky 9 (husky)
- Fix "AttributeError: 'ImageDraw' object has no attribute 'textsize'" in Pillow 10 (Pillow)
- Fix imageio GIFs That Play With No Frame Delay After Upgrading (mimsave duration) (imageio)
- Fix "SyntaxError: Unexpected identifier 'assert'" in rollup.config.js on Node.js 22 (Rollup)
- Fix "error TS5102: Option 'importsNotUsedAsValues' has been removed" in tsconfig.json (TypeScript)
- Fix "ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape" (NumPy)