fix: use environment HTTP proxies for CDP connections - #30
Merged
TristanIsK merged 7 commits intoSep 20, 2026
Merged
Conversation
TristanIsK
marked this pull request as ready for review
September 18, 2026 10:55
TristanIsK
commented
Sep 18, 2026
Collaborator
Author
|
codex云 agent 运行的沙箱,网络请求会走代理,因此需要判断 http_proxy 环境变量来适配环境。 |
Collaborator
|
[P2] 15 秒连接超时未覆盖代理 DNS 解析 — proxy.rs:90 [P2] SDK 集成测试会受到宿主机代理配置影响,已复现 — cdp.rs:56 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
云端 Agent 配置 HTTP 代理时,原有 HTTP 客户端可以创建浏览器会话,但 CDP WebSocket 仍然直连,导致后续网页操作连接失败。本 PR 在 CLI 和 SDK 共用的 CDP 连接入口支持环境代理,并补齐连接超时及兼容性处理,版本准备为
1.2.1。变更内容
HTTP_PROXY、HTTPS_PROXY、ALL_PROXY、对应小写变量及NO_PROXY。仅支持http://CONNECT 代理;HTTPS-to-proxy 和 SOCKS 返回明确错误。error: timeout、发生阶段及预算,退出码为1。错误信息不包含 URL 或凭据。审查意见及修复
NO_PROXY,覆盖直连与代理之间切换。native-tls时也能正常连接。Arc<TcpStream>共享同一个操作系统句柄进行读写和超时清除,避免依赖复制句柄的行为;完成清理后设置连接完成标志,后续 CDP 读写不再受连接预算影响。已确认的边界
系统正在执行的 DNS 查询无法强制取消;调用方超时退出后,后台资源仍受上述上限约束。容量耗尽时,新域名查询明确返回
DNS resolver busy; retry later,等待工作线程恢复。15 秒预算结束于 WebSocket 升级完成。REST 会话请求、CDP 目标初始化和后续网页操作保留原有超时行为,因此不是整条 CLI 命令或 Agent 对话的总时限;不会自动重试网页操作。公开 SDK 接口保持不变。
验证结果
当前验证提交:248781f。
clippy -- -D warnings通过。1,连接关闭且未发送网页操作。74daec6上能复现unsupported CDP TLS backend,已接入 CI。test(含不可用代理环境复测、四种 TLS 组合、格式检查及 clippy)、linux-release、windows-bootstrap、windows-release。早期真实 ChatGPT Work 云端验收使用的是 af092b0 构建产物,已通过版本检查、doctor、创建会话、打开 example.com、快照、标题、截图和关闭会话;该记录不能作为当前提交的云端复测结果。
发布说明
本 PR 已于 2026-09-20 由用户合并,合并提交为
b41e08524b13729fa0b84b595a4b4acffdc3b865。CLI v1.2.1 已正式发布,三平台二进制已上传 GitHub 和 COS,公开下载及 SHA256 校验通过;发布流水线全部成功。插件1.1.19草稿的 CLI 产物依赖已满足;本次未提交插件审核,当前正式包尚未重新进行真实 ChatGPT Work 云端验收。