fix-codex-proxy-reconnect

用于修复在代理网络切换后,Codex WebSocket 连续重试五次的问题,要求不修改 config.toml 文件。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "fix-codex-proxy-reconnect":https://skillpi.com/zh/skills/deepskill-b5118dcdd908b2e6fc50963eff11703671e8809a11a47e15f4b564dbcc246e52。安装前核对上游来源和版本:https://skillhub.cn/skills/user_24a4e079/fix-codex-proxy-reconnect。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于修复在代理网络切换后,Codex WebSocket 连续重试五次的问题,要求不修改 config.toml 文件。

0 下载

介绍来源: third_party · user_24a4e079 · 1.0.0 参考来源

SkillPi 解读

能完成的任务
Diagnose and fix Codex Desktop or CLI repeatedly retrying WebSocket connections after a network change while normal browser traffic still works, especially the exact five-retry pattern behind an HTTP/SOCKS proxy. Use for Codex connection reset, responses_websocket, retry 1/5 through 5/5, or fallback-to-HTTP symptoms; configure an explicit proxy in ~/.codex/.env without modifying config.toml or changing the model provider. 适用于代理网络断线重连后 Codex 连续重试五次、但浏览器正常的排查与修复。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: fix-codex-proxy-reconnect
slug: fix-codex-proxy-reconnect
version: 1.0.0
displayName: 修复 Codex 代理重连
summary: 修复代理网络切换后 Codex WebSocket 连续重试五次的问题,不改动 config.toml。
tags: [codex, proxy, websocket, network]
description: Diagnose and fix Codex Desktop or CLI repeatedly retrying WebSocket connections after a network change while normal browser traffic still works, especially the exact five-retry pattern behind an HTTP/SOCKS proxy. Use for Codex connection reset, responses_websocket, retry 1/5 through 5/5, or fallback-to-HTTP symptoms; configure an explicit proxy in ~/.codex/.env without modifying config.toml or changing the model provider. 适用于代理网络断线重连后 Codex 连续重试五次、但浏览器正常的排查与修复。

Fix Codex Proxy Reconnect

Repair stale proxy routing after a network interruption while preserving the user's model provider, login, and task history.

Workflow

  1. Confirm the symptom before editing anything.

    • Check whether browser traffic works while Codex alone retries.
    • Look for responses_websocket, retry 1/5 through 5/5, Connection reset by peer, or falling back to HTTP in Codex logs.
    • Read references/diagnosis.md for platform-specific commands and interpretation.
  2. Identify the active local proxy endpoint.

    • Inspect the proxy application's HTTP or mixed-proxy listening port.
    • Verify the port is listening. Do not assume port 7892 on a different device.
    • Prefer an HTTP/mixed endpoint such as http://127.0.0.1:7892 when the proxy application provides one.
  3. Preserve existing configuration.

    • Do not modify ~/.codex/config.toml.
    • Do not add a custom model provider merely to set supports_websockets = false; changing provider identity can hide existing task history in Codex Desktop.
    • Inspect ~/.codex/.env before applying. Preserve unrelated keys.
  4. Apply explicit proxy routing.

python3 scripts/configure_proxy_env.py status
python3 scripts/configure_proxy_env.py apply --proxy-url http://127.0.0.1:7892

Run the bundled script from this skill's directory, or use its absolute path. It updates only HTTP_PROXY, HTTPS_PROXY, and NO_PROXY, creates a timestamped backup when content changes, writes atomically, and leaves config.toml untouched.

  1. Fully quit and reopen Codex.

    • A new process is required because Codex loads ~/.codex/.env at startup.
    • Verify the existing task list remains visible.
    • Send one request, interrupt and restore the network, then send another request. Confirm that the five-retry delay is gone.
  2. Report the result precisely.

    • State that this fix makes WebSocket reconnect through an explicit proxy route.
    • Do not claim it forces HTTP streaming. WebSocket may still be used successfully.

Rollback

Restore the backup path printed by apply:

python3 scripts/configure_proxy_env.py restore --backup ~/.codex/.env.bak-YYYYMMDD-HHMMSS-ffffff

If no prior .env existed and the user wants only the managed keys removed:

python3 scripts/configure_proxy_env.py remove

Fully restart Codex after rollback.

Guardrails

  • Never write a guessed or inactive proxy port; it can prevent Codex from connecting at all.
  • Ask for approval before writing outside the workspace when the environment requires it.
  • Keep proxy credentials out of chat and logs. The script redacts credentials in status output.
  • Treat CODEX_* WebSocket-disable recipes as version-dependent and verify them against the installed build. Some Codex builds filter CODEX_ keys loaded from ~/.codex/.env.
  • If explicit routing does not help, continue with stale proxy processes, VPN/TUN state, firewall, TLS inspection, DNS, and proxy WebSocket support rather than repeatedly changing provider configuration.

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

  • 针对 Codex 代理网络切换后 WebSocket 连续重试五次的实际问题,提供明确诊断与修复流程
  • 不改动 config.toml,保留用户配置与任务历史,具有明确实用价值
触发精准85/100

亮点

  • description 中提供了详细的触发关键词(如 responses_websocket、retry 1/5 等)和适用场景
  • 覆盖合理,边界清晰
结构规范92/100

亮点

  • 结构清晰,包含 Workflow、Rollback、Guardrails 等章节
  • 步骤明确,有具体命令示例,frontmatter 完整
执行可靠88/100

亮点

  • 提供了具体的 Python 脚本命令,包含备份、原子写入、凭证脱敏等可靠性机制
  • 覆盖主要异常,不可逆操作有确认机制
证据可验 (前四项均值)86/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 账号、密钥或授权

    使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。

    主文档提及 · 第 70 行
文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • 127.0.0.1

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。