patch-codex-fast

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Patch Codex Fast

为Codex打补丁以启用快速模式

Use this skill when the user wants to enable Codex desktop Fast/Speed mode or Plugins while running Codex with an API key instead of ChatGPT OAuth login. Also use it when the user asks whether Codex remote SSH sessions can open files in Zed, or asks to patch Codex so remote files can be opened with Zed.
This skill is the main interface after installation through
npx skills
or a manual symlink. Do not make the user copy long shell snippets from the README. Use the scripts in this repository as execution assets, run the right command for the current OS, then report the result and verification steps.
This is an unofficial local patch. Before changing the app, make sure the user understands that it modifies the installed Codex desktop bundle, disables selected Electron integrity fuses, and may need to be re-applied after Codex updates.
当用户希望在使用API密钥而非ChatGPT OAuth登录运行Codex桌面端时启用快速模式(Fast/Speed mode)或插件功能,或者用户询问Codex远程SSH会话是否可以在Zed中打开文件、请求为Codex打补丁以实现用Zed打开远程文件时,可使用本技能。
本技能是通过
npx skills
或手动创建符号链接安装后的主界面。不要让用户从README中复制冗长的Shell代码片段。请使用本仓库中的脚本作为执行资源,针对当前操作系统运行正确的命令,然后报告结果和验证步骤。
这是非官方的本地补丁。在修改应用之前,请确保用户了解:该补丁会修改已安装的Codex桌面端包,禁用部分Electron完整性保护机制,并且在Codex更新后可能需要重新应用。

Intent

意图

The user should be able to say:
text
[$patch-codex-fast] Patch my local Codex app so Fast mode and Plugins work in API key mode.
Then the agent should execute the workflow end to end, not respond with a manual recipe. The script commands below are for the agent to run, not for the user to copy as the primary path.
用户只需说出:
text
[$patch-codex-fast] Patch my local Codex app so Fast mode and Plugins work in API key mode.
随后Agent应端到端执行整个工作流,而不是返回手动操作步骤。下方的脚本命令供Agent运行,而非让用户作为主要操作路径复制使用。

Workflow

工作流

  1. Identify the repository root that contains this
    SKILL.md
    .
  2. Run a doctor check with the repository script.
  3. If the environment is valid, run the patch script for the current OS.
  4. Read the full command output and report:
    • whether patch actions were applied,
    • any warnings,
    • the exact rollback command.
  5. Ask the user to completely quit and reopen Codex, then verify:
    • Fast/Speed mode is visible in API key mode,
    • the Plugins sidebar is visible in API key mode,
    • plugin install flow no longer marks all connectors unavailable,
    • Computer Use settings still show the Google Chrome plugin row.
  6. If Codex fails to launch or the user reports a broken state, run rollback immediately.
For the Zed remote-open patch only:
  1. Run
    doctor
    or
    zed-remote-status
    .
  2. If the environment is valid, run
    patch-zed-remote
    .
  3. Read the full output and report whether the Zed target was marked
    supportsSsh
    and whether the remote URL helper was inserted.
  4. Tell the user to completely quit and reopen Codex, then verify that a remote Codex file shows Zed under Open With and opens in Zed Remote Development.
  5. If Codex fails to launch or the user reports a broken state, run rollback immediately.
  1. 找到包含本
    SKILL.md
    文件的仓库根目录。
  2. 使用仓库中的脚本运行诊断检查。
  3. 如果环境验证通过,针对当前操作系统运行补丁脚本。
  4. 读取完整的命令输出并报告:
    • 是否已应用补丁操作,
    • 任何警告信息,
    • 精确的回滚命令。
  5. 请用户完全退出并重新打开Codex,然后验证:
    • 在API密钥模式下可见快速模式(Fast/Speed mode),
    • 在API密钥模式下可见插件侧边栏,
    • 插件安装流程不再标记所有连接器为不可用,
    • “计算机使用”设置中仍显示Google Chrome插件选项。
  6. 如果Codex无法启动或用户报告异常状态,立即执行回滚操作。
仅针对Zed远程打开补丁:
  1. 运行
    doctor
    zed-remote-status
    命令。
  2. 如果环境验证通过,运行
    patch-zed-remote
    命令。
  3. 读取完整输出并报告Zed目标是否被标记为
    supportsSsh
    ,以及是否已插入远程URL辅助工具。
  4. 请用户完全退出并重新打开Codex,然后验证远程Codex文件的“打开方式”选项中显示Zed,且能在Zed远程开发环境中打开。
  5. 如果Codex无法启动或用户报告异常状态,立即执行回滚操作。

Commands

命令

Prefer the cross-platform Python entrypoint:
bash
python3 scripts/patch_codex_fast.py doctor
python3 scripts/patch_codex_fast.py patch
python3 scripts/patch_codex_fast.py patch-zed-remote
python3 scripts/patch_codex_fast.py zed-remote-status
python3 scripts/patch_codex_fast.py rollback
On Windows, use
python
if
python3
is unavailable:
powershell
python .\scripts\patch_codex_fast.py doctor
python .\scripts\patch_codex_fast.py patch
python .\scripts\patch_codex_fast.py patch-zed-remote
python .\scripts\patch_codex_fast.py zed-remote-status
python .\scripts\patch_codex_fast.py rollback
Wrappers are also available:
bash
./scripts/macos-patch.sh
./scripts/macos-rollback.sh
powershell
.\scripts\windows-patch.ps1
.\scripts\windows-rollback.ps1
优先使用跨平台的Python入口:
bash
python3 scripts/patch_codex_fast.py doctor
python3 scripts/patch_codex_fast.py patch
python3 scripts/patch_codex_fast.py patch-zed-remote
python3 scripts/patch_codex_fast.py zed-remote-status
python3 scripts/patch_codex_fast.py rollback
在Windows系统中,如果
python3
不可用,请使用
python
powershell
python .\scripts\patch_codex_fast.py doctor
python .\scripts\patch_codex_fast.py patch
python .\scripts\patch_codex_fast.py patch-zed-remote
python .\scripts\patch_codex_fast.py zed-remote-status
python .\scripts\patch_codex_fast.py rollback
也提供封装脚本:
bash
./scripts/macos-patch.sh
./scripts/macos-rollback.sh
powershell
.\scripts\windows-patch.ps1
.\scripts\windows-rollback.ps1

Default paths

默认路径

macOS:
  • Resources:
    /Applications/Codex.app/Contents/Resources
  • App path:
    /Applications/Codex.app
Windows:
  • Resources:
    %LOCALAPPDATA%\Programs\Codex\resources
  • App path:
    %LOCALAPPDATA%\Programs\Codex\Codex.exe
If Codex is installed somewhere else, pass
--resources-dir
and
--app-path
to the Python command.
macOS系统:
  • Resources:
    /Applications/Codex.app/Contents/Resources
  • App path:
    /Applications/Codex.app
Windows系统:
  • Resources:
    %LOCALAPPDATA%\Programs\Codex\resources
  • App path:
    %LOCALAPPDATA%\Programs\Codex\Codex.exe
如果Codex安装在其他位置,请在Python命令中传入
--resources-dir
--app-path
参数。

Rollback policy

回滚策略

Rollback is part of the skill, not an afterthought. If patching fails after files were changed, or if the app does not launch, run:
bash
python3 scripts/patch_codex_fast.py rollback
On Windows:
powershell
python .\scripts\patch_codex_fast.py rollback
The rollback script must restore
app.asar
before deleting
app/
, then restore the stock Electron fuses and re-sign on macOS. If macOS blocks writing inside
/Applications/Codex.app
with
Operation not permitted
, stop before deleting
app/
; grant App Management access or move the app bundle aside, copy it back, restore
app.asar
, and re-sign.
回滚是本技能的一部分,而非事后补救措施。如果在文件修改后补丁应用失败,或者应用无法启动,请运行:
bash
python3 scripts/patch_codex_fast.py rollback
在Windows系统中:
powershell
python .\scripts\patch_codex_fast.py rollback
回滚脚本必须在删除
app/
目录前恢复
app.asar
文件,然后在macOS系统中恢复默认的Electron保护机制并重新签名。如果macOS系统提示“Operation not permitted”(操作不被允许)而阻止写入
/Applications/Codex.app
目录,请在删除
app/
目录前停止操作;授予应用管理权限或将应用包移至别处,再复制回来,恢复
app.asar
文件并重新签名。

Bundle update handling

包更新处理

When Codex updates, bundle hashes and minified variable names may change. First re-run the skill normally. If the script reports
No patches were applied
, inspect the extracted
app/webview/assets
directory with these searches:
bash
grep -rl "authMethod" *.js | xargs grep -l "fast_mode"
grep -rl "pluginsDisabledTooltip" *.js
当Codex更新后,包哈希值和压缩后的变量名可能会变化。首先正常重新运行本技能。如果脚本报告
No patches were applied
(未应用任何补丁),请使用以下搜索命令检查提取后的
app/webview/assets
目录:
bash
grep -rl "authMethod" *.js | xargs grep -l "fast_mode"
grep -rl "pluginsDisabledTooltip" *.js

Gate exported from gradient-*.js. Two known variants live in the wild:

Gate exported from gradient-*.js. Two known variants live in the wild:

older builds: function e(e){return e===
apikey
}

older builds: function e(e){return e===
apikey
}

newer builds: function e(e){return e!==
chatgpt
}

newer builds: function e(e){return e!==
chatgpt
}

Both should be rewritten to
return false
.

Both should be rewritten to
return false
.

grep -rlE 'return [A-Za-z_$]+(===|!==)
(apikey|chatgpt)
' *.js | grep -v locale grep -rl "connector-unavailable" *.js | grep plugin

Patch the same logical gates described in the README if automated patterns no longer match. Also preserve Chrome by checking these app-bundle surfaces:

```bash
grep -rl "chrome-internal" app/.vite/build
grep -rl "externalBrowserUseAllowed" app/.vite/build
grep -rl "isExternalBrowserUseAvailable" app/webview/assets
The current fix maps the Dev runtime Chrome plugin name from
chrome-internal
to
chrome
, keeps the Chrome marketplace descriptor from being dropped by the external-browser feature gate, and prevents the renderer plugin list from hiding Chrome when
isExternalBrowserUseAvailable
is false.
For Zed remote-open support, inspect the main process open-target bundle:
bash
grep -rl "id:\`zed\`" app/.vite/build
grep -rl "supportsSsh" app/.vite/build
grep -rl "vscode-remote://" app/.vite/build
The Zed patch keeps local Zed behavior unchanged, marks Zed as SSH-capable for Codex remote sessions, and converts the remote path passed by Codex into a Zed Remote Development URL such as
ssh://user@host[:port]/path
. Prefer Codex’s structured SSH config fields over the display alias so Zed does not fall back to the wrong local macOS username.
grep -rlE 'return [A-Za-z_$]+(===|!==)
(apikey|chatgpt)
' *.js | grep -v locale grep -rl "connector-unavailable" *.js | grep plugin

如果自动匹配模式失效,请按照README中描述的逻辑进行手动补丁。同时,请通过检查以下应用包内容来保留Chrome插件功能:

```bash
grep -rl "chrome-internal" app/.vite/build
grep -rl "externalBrowserUseAllowed" app/.vite/build
grep -rl "isExternalBrowserUseAvailable" app/webview/assets
当前修复方案将开发环境下的Chrome插件名称从
chrome-internal
映射为
chrome
,确保Chrome应用市场描述符不会被外部浏览器功能限制移除,并且在
isExternalBrowserUseAvailable
为false时,渲染器插件列表不会隐藏Chrome。
对于Zed远程打开功能支持,请检查主进程的打开目标包:
bash
grep -rl "id:\`zed\`" app/.vite/build
grep -rl "supportsSsh" app/.vite/build
grep -rl "vscode-remote://" app/.vite/build
Zed补丁保持本地Zed的行为不变,将Zed标记为支持Codex远程会话的SSH目标,并将Codex传递的远程路径转换为Zed远程开发URL,例如
ssh://user@host[:port]/path
。优先使用Codex的结构化SSH配置字段而非显示别名,以避免Zed错误地回退到本地macOS用户名。

Success criteria

成功标准

The task is not complete until the agent has command evidence for the patch or rollback path and has told the user exactly what to verify in the Codex UI, including the Google Chrome row under Computer Use for the Fast/Plugins patch or the remote Open With → Zed flow for the Zed remote patch.
只有当Agent获取到补丁或回滚操作的命令执行证据,并告知用户在Codex界面中需要验证的具体内容(包括快速模式/插件补丁对应的“计算机使用”中的Google Chrome选项,或Zed远程补丁对应的远程文件“打开方式”→Zed流程)后,任务才算完成。