Markdown file:// links open in default browser (Edge) instead of VS Code editor
Environment:
- OS: Windows 11 Pro 10.0.26200
- VS Code: 1.109.5 (x64)
- Extension: openai.chatgpt 0.5.76
Steps to reproduce:
1) Open the ChatGPT/Codex sidebar in VS Code.
2) Obtain any response that contains a Markdown link to a local .md file, for example:
[README.md](file:///C:/path/to/README.md)
3) Click the link inside the chat message rendering.
Expected:
- The linked local Markdown file opens in a VS Code editor tab.
Actual:
- The link opens via the OS default browser (Microsoft Edge), showing the Markdown in the browser.
Observed routing in extension source:
In webview/assets/index-*.js, the Markdown renderer attaches an onClick handler that dispatches "open-in-browser" for link clicks:
"_blank", rel:"noopener noreferrer", onClick:h=>{!a||!MZt(a)||(h.preventDefault(),Xt.dispatchMessage("open-in-browser",{url:TZt(a)}))}
In out/extension.js, the "open-in-browser" message is handled via vscode.env.openExternal():
case "open-in-browser": {
Ee.env.openExternal(Ee.Uri.parse(r.url));
break;
}
Result:
- When the href is a file:// URI to a local .md, the click path goes through openExternal and is handed to the OS, which opens the default browser (Edge).
47 Comments
Regression after update to openai.chatgpt 0.5.78:
I had closed this issue because the behavior was fixed after an earlier update, but after updating to 0.5.78 it is reproducible again.
Environment:
Steps:
1) Open the Codex sidebar in VS Code
2) Click a Markdown link to a local file://…/*.md inside the webview message
Expected:
Actual:
If you want, I can test specific builds or provide logs, but the reproduction is consistent on 0.5.78.
I have this issue as well
I have this issue too it was ok 2 days ago
I'm seeing this as well. It isn't limited to Markdown; .asm files are also affected.
Since this morning any link to a file in codex is opening in the browser rather than the editor..
e.g.
https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/Joe/.vscode/extensions/openai.chatgpt-0.4.79-win32-x64/webview/I have this issue as well
yes i have it also
i have it also
我也有这个问题
I encounter this issue with file+.vscode-resource.vscode-cdn.net/xxxxx
Same! It is affecting all of my files (csv, java, yml, tsx, etc)
Yes, same, it REALLY impedes my workflow.
Just started having this issue after the 5.4 update
the same annoying problem.
Repro update from Windows + Cursor
Environment
Repro steps
https://file+.vscode-resource.vscode-cdn.net/...(sometimes with a trailing#).Expected
Actual
Notes
.md,.html,.ts).code --goto/cursor --goto.Workaround we are using on Windows (until extension-side fix lands):
This consistently opens the expected local file and avoids the broken webview URL hop.
Adding a more specific repro from VS Code on Windows 11.
Environment:
Observed behavior:
ext
https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/Jared%20Mahotiere/.vscode/extensions/openai.chatgpt-26.304.20706-win32-x64/webview/
Why this seems useful diagnostically:
Impact:
If helpful I can also provide a short screen recording / exact message format that triggered it.
I also have this problem
VSCode insider is also having this issue... Extremely annoying, can't lie
use ChatGPT Codex inside Visual Studio Code to apply these instructions to apply the fix.
OPENAI_CHATGPT_LOCAL_FILE_LINK_PATCH_26.304.20706_PORTABLE.md
this repair works well in my codex in cursor in Win11Pro ,just put the MD to a cursor to repair this issue
why openAI still don't fix this?
THANK YOU!!!
Sincere appreciation to @booogy for the patch. Personally I'm not gonna use it, but huge kudos for your insight.
The problem will recur after the version is upgraded. Use this script to fix it with command:
patch_openai_chatgpt_local_file_links.zip
this is happening to all types of files, not just .md.. its expected that any file if thats present on local, open in vscode itself if the clicable link given in codex
The problem will recur after the version is upgraded. Use this script to fix it with command
It has now been updated to version 26.325.21211,
The content has been adjusted , but the command-line statement executed has not changed for compatibility, it is still:
apply_codex_local_file_link_patch_26.325.21211.zip
why openAI still hasn't fix this bug after so many days , and it seems like not that hard.
@kiss10101 does it fix .json, .md or ,py file extension? I just want them to open in vscode itself.
Is OpenAI planning to abandon the IDE plugin and focus on the Codex app instead?
@kiss10101 the given patch did not fic my issue. Clickable file names mentioned by codex chat in vscode still opens in browser rather than vscode itself. Please can you help?
After executing this command line statement, did you press
Ctrl+Pin VS Code to bring up the management panel, and then run theReload Windowcommand?and pay attention that this is for a specific version :26.325.21211@abhinandangajar yes, I tested the files with the suffix of
.bat .css .csv .html .ini .js .json .log .md .ps1 .py .sh .sql .toml .ts .txt .xml .ymlI just did a simple test, and it works for common file types. I'll do some more in-depth tests later
The test results have been provided in the previous entry
After running the script, the Codex extension UI fails to initialize and stays stuck in a perpetual loading state. Reloading the window didn't fix it.
Every time the version updated, it will change the structure causing the old string matching in the script to fail. Try my new script uploaded this time.
可以将这个脚本丢给codex,让他根据内容自己改。
我已经直接改好了扩展里的 markdown 渲染 bundle,没有用到 Node。
这次补的是最新版扩展:
C:\xxx\openai.chatgpt-26.325.31654-win32-x64\webview\assets\markdown-Cqst3qDh.js
做了两件关键事:
放行本地文件链接:tO(...) 现在会允许 ZS(e) / QS(e) 这类本地文件 href,不再被 urlTransform 干掉
规范化 Windows markdown 路径:插入了 __codexNormalizeWindowsMarkdownLinks(...),会把像 x 这种路径转成更稳定的斜杠形式再渲染
备份也已经留好了:
C:\xxx\openai.chatgpt-26.325.31654-win32-x64\webview\assets\markdown-Cqst3qDh.js.codex-local-file-link.bak
你现在需要做的基本只有一步:
完全重载 VS Code 窗口,或者把 VS Code 关掉再打开
This fucking bug has been around for two months already. Why the hell hasn't it been fixed yet? FK!
i try @kiss10101 apply_codex_local_file_link_patch.zip fix this bug, thx you
Also pushing this up again, I do have a Codex conversation that will temporarily fix the problem (based on one of the prompts above) but I have to ask Codex every other day "can you please fix it again"...
Definitely every new update makes the bug come back again, sometimes the fix works, last time I had to downgrade to get Codex back to working order again, it's extremely disruptive to the workflow.
A work around is to let the agent output the file path in the form of \
@PATH\instead of default \[x](PATH) formThe backtip mark is included.
SAME! any link to a file in codex is opening in the browser rather than the editor..
Welp, time to make an open OpenAI Codex extension.
<img width="1258" height="683" alt="Image" src="https://github.com/user-attachments/assets/96b8d4da-9528-4de0-95b7-d3a037e52567" />
ChatGPT Review
Finally a working solution. And making a skill that tells Codex to always do it this way also helped
This is not working anymore either.
Can confirm.
As of v26.409.20454 it stopped working as well.
As a workaround rolling back to 26.406.31014.
VS Code: 1.115.0
OS: Windows_NT x64 10.0.19045
26.5422.21459好像已经修复了这一问题
但是最近的版本有一个git相关的错误,没有git init的项目codex扩展会后台循环某些进程导致高cpu占用
is that fixed?