Skip to content

[codex] Respect proxy env for Codex clients#11414

Closed
Chesszyh wants to merge 1 commit into
NousResearch:mainfrom
Chesszyh:codex/respect-proxy-env-for-codex
Closed

[codex] Respect proxy env for Codex clients#11414
Chesszyh wants to merge 1 commit into
NousResearch:mainfrom
Chesszyh:codex/respect-proxy-env-for-codex

Conversation

@Chesszyh

Copy link
Copy Markdown

Summary

  • avoid injecting a custom httpx.HTTPTransport when proxy environment variables are present
  • let the OpenAI SDK/httpx default transport honor HTTPS_PROXY, HTTP_PROXY, and ALL_PROXY
  • add regression coverage for proxied Codex/OpenAI client creation

Root Cause

Hermes injects a custom httpx.Client(transport=httpx.HTTPTransport(...)) to add TCP keepalive socket options. When a custom transport is provided, httpx does not use its default environment proxy handling. Users behind local HTTP(S) proxies can therefore have Codex/OpenAI requests direct-connect even when HTTPS_PROXY is configured, resulting in connection timeouts.

Impact

This keeps the existing keepalive behavior for users without proxy env vars, while allowing proxied setups to work through the SDK/httpx default proxy-aware transport.

Validation

  • ./venv/bin/python -m pytest tests/run_agent/test_create_openai_client_reuse.py -q
  • local smoke test: ./venv/bin/hermes chat -Q -t '' --max-turns 1 -q '只回复 OK 两个字母。'

@Chesszyh Chesszyh closed this Apr 17, 2026
@Chesszyh Chesszyh deleted the codex/respect-proxy-env-for-codex branch April 17, 2026 05:16
@SparkleBo

Copy link
Copy Markdown

遇到了同样的问题,想问下 MR 为什么关了。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants