fix-codex-proxy-reconnect
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "fix-codex-proxy-reconnect" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-b5118dcdd908b2e6fc50963eff11703671e8809a11a47e15f4b564dbcc246e52. Verify the upstream source and version against https://skillhub.cn/skills/user_24a4e079/fix-codex-proxy-reconnect before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Intended to fix the issue where Codex WebSocket retries five times continuously after a proxy network switch, with the constraint of not modifying the config.toml file.
Introduction source: third_party · user_24a4e079 · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
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
-
Confirm the symptom before editing anything.
- Check whether browser traffic works while Codex alone retries.
- Look for
responses_websocket,retry 1/5through5/5,Connection reset by peer, orfalling back to HTTPin Codex logs. - Read references/diagnosis.md for platform-specific commands and interpretation.
-
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
7892on a different device. - Prefer an HTTP/mixed endpoint such as
http://127.0.0.1:7892when the proxy application provides one.
-
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/.envbefore applying. Preserve unrelated keys.
- Do not modify
-
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.
-
Fully quit and reopen Codex.
- A new process is required because Codex loads
~/.codex/.envat 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.
- A new process is required because Codex loads
-
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
statusoutput. - Treat
CODEX_*WebSocket-disable recipes as version-dependent and verify them against the installed build. Some Codex builds filterCODEX_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.
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对 Codex 代理网络切换后 WebSocket 连续重试五次的实际问题,提供明确诊断与修复流程
- 不改动 config.toml,保留用户配置与任务历史,具有明确实用价值
Highlights
- description 中提供了详细的触发关键词(如 responses_websocket、retry 1/5 等)和适用场景
- 覆盖合理,边界清晰
Highlights
- 结构清晰,包含 Workflow、Rollback、Guardrails 等章节
- 步骤明确,有具体命令示例,frontmatter 完整
Highlights
- 提供了具体的 Python 脚本命令,包含备份、原子写入、凭证脱敏等可靠性机制
- 覆盖主要异常,不可逆操作有确认机制
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 70
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- 127.0.0.1
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.