Hot patch utility for the VS Code Codex/OpenAI ChatGPT extension when local file links in chat stop opening in the editor.
This tool patches the installed openai.chatgpt-* VS Code extension by replacing webview/assets/codex-local-link-patch.js with a more aggressive local-file handler.
The patch currently improves two cases:
- Markdown links such as
package.json,Dockerfile,.env, relative paths, absolute paths, andfile://links. - Blue file-link buttons rendered by the Codex webview that do not use a normal
<a>tag.
Run the patcher:
npm install
npm run patchOr run the script directly:
node ./src/patch-vscode-links.mjsPreview what the tool would do without writing files:
npm run patch:dry-runRestore from backups if they exist:
npm run restorePreview a restore without changing files:
npm run restore:dry-runAfter patching, reload the VS Code window:
Developer: Reload Window
- The patch targets the newest installed
openai.chatgpt-*extension under~/.vscode/extensions/. - If the extension updates, re-run the patch.
- The patcher keeps one-time backups at
codex-local-link-patch.js.origand, when needed,index.html.orig. restoreonly works when a backup exists for the current extension install.
codex-vscode-link-patch/
README.md
requirements.txt
.gitignore
package.json
src/
patch-vscode-links.mjs
codex-local-link-patch.template.js
notes/
experiments/