You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Markdown file:// links open in default browser (Edge) instead of VS Code editor #12661
Obtain any response that contains a Markdown link to a local .md file, for example:
README.md
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:
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).
Reacted by Swah, EstebanBDG, Telma C., JoeMMesser, Alexander Mezhov, Chengkai Xu, vincentdemers-glitch, anhtientran1048, Jason Hu, petterton and 35 more
Reacted by Jason W. Thompson, sergeyopen88-dot and virtushda
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:
OS: Windows 11 Pro 10.0.26200
VS Code: 1.109.5 (x64)
Extension: openai.chatgpt 0.5.78
Steps:
Open the Codex sidebar in VS Code
Click a Markdown link to a local file://…/*.md inside the webview message
Expected:
Opens the Markdown file in a VS Code editor tab
Actual:
Opens the link via the OS default browser (Edge), same as before
If you want, I can test specific builds or provide logs, but the reproduction is consistent on 0.5.78.
Reacted by EstebanBDG, Chengkai Xu, CodiBasti, vincentdemers-glitch, spider853, Deniz Çelebi, Tasneem Zahdeh, Mahyar Koshkouei, Chinonso Oragwam, virtushda and 5 more
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/
Reacted by Deniz Çelebi, petterton, Tasneem Zahdeh, Dr. Martin Sona, pjeansonzilliant, Mahyar Koshkouei, esando96, sergeyopen88-dot, aoaoaoao-wu, CaFeZn and 5 more
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.
Welp, time to make an open OpenAI Codex extension.
ChatGPT Review
Primary regression
- extension/src/components/markdown/file-reference.ts:95
parseFileReference() trims text but does not decode URI-encoded file refs.
- extension/src/components/markdown/file-reference.ts:188
isFileReference() is the main gate for markdown file links.
- extension/src/components/markdown/file-reference.ts:191
isFileReference() rejects any scheme:// href, so file://... never becomes a FileLink.
- extension/src/components/markdown/render-prompt-link.tsx:99
Markdown links are only upgraded to FileLink if isFileReference(href) or isAbsoluteFilesystemReference(href) succeeds.
- extension/src/components/markdown.tsx:452
The anchor renderer calls renderPromptLink(...) first.
- extension/src/components/markdown.tsx:467
When that fails, the fallback <a> path routes scheme URLs to open-in-browser.
- extension/src/components/markdown.tsx:689
urlTransform(...) whitelists app/plugin/agent hrefs and image src, but not local file hrefs.
Windows path handling
- extension/src/components/markdown.tsx:619
displayChildren is the last clean pre-render hook before ReactMarkdown.
- extension/src/components/markdown.tsx:727
displayChildren is passed directly into <ReactMarkdown>.
- extension/src/components/markdown/remark-preserve-windows-paths.ts:123
The existing plugin only preserves backslashes in text nodes; it does not normalize markdown link destinations like [x](C:\foo\bar.ts) before parsing.
Known-good open path
- extension/src/components/markdown/mention-chips.tsx:209
FileLink component.
- extension/src/components/markdown/mention-chips.tsx:226
FileLink already uses useMutationFromVSCode("open-file"), so correctly classified links already follow the proper editor-open path.
Host-side note
- raw/extension/out/extension.js
The host bundle's "open-file" handler already has an absolute-path branch. Host-side URI decoding is still a useful hardening fix, but the primary regression is in the webview markdown classification path above.
Minimal fix set
- Decode URI-encoded file refs before parsing.
- Stop classifying local file-style hrefs as generic external URLs.
- Normalize Windows markdown link destinations before ReactMarkdown render.
- Keep host-side path decoding as a fallback/hardening change.
A workaround that avoids the OS browser handoff is to stop using file:// links for workspace files:
Ask Codex to return a workspace-relative path, for example [README.md](README.md), or just the plain relative path.
Click the relative link first.
If the current renderer still routes it externally, use VS Code Quick Open (Ctrl+P / Cmd+P) and paste that relative path.
Verify the file opens in an editor tab rather than the system browser.
Limitation: this is only reliable for files inside the open workspace. Files outside the workspace still need to be opened explicitly, and this does not fix the extension's file:// click routing.
The issue is still open, and I do not have reliable evidence that current releases have fixed the Windows/macOS file:// click-routing problem.
The older 26.5422.21459 report is not enough to establish a current fix, especially because later comments still report the regression. The temporary method remains:
Ask Codex to emit a workspace-relative path or Markdown link such as [README.md](README.md), not a file:// URL.
If the link still routes externally, open the file with VS Code Quick Open (Ctrl+P / Cmd+P) using that relative path.
Treat files outside the active workspace as requiring explicit manual opening.
Activity
CT-2026 commentedon Feb 26, 2026
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:
Expected:
Actual:
If you want, I can test specific builds or provide logs, but the reproduction is consistent on 0.5.78.
HumboldtK commentedon Mar 1, 2026
I have this issue as well
kelesmert commentedon Mar 1, 2026
I have this issue too it was ok 2 days ago
MadProff31 commentedon Mar 1, 2026
I'm seeing this as well. It isn't limited to Markdown; .asm files are also affected.
fender commentedon Mar 2, 2026
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/denizyigit commentedon Mar 2, 2026
I have this issue as well
Klwildri commentedon Mar 3, 2026
yes i have it also
staytomorrow commentedon Mar 4, 2026
i have it also
HckSir commentedon Mar 4, 2026
我也有这个问题
Andreas-UI commentedon Mar 5, 2026
I encounter this issue with file+.vscode-resource.vscode-cdn.net/xxxxx
27 remaining items
woodlynn commentedon Mar 30, 2026
可以将这个脚本丢给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 关掉再打开
zedrun00 commentedon Mar 31, 2026
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
CargoCultScientist commentedon Mar 31, 2026
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.
Charl-Ep commentedon Apr 1, 2026
A work around is to let the agent output the file path in the form of `@PATH` instead of default [x](PATH) form
The backtip mark is included.
zx20030501 commentedon Apr 1, 2026
SAME! any link to a file in codex is opening in the browser rather than the editor..
clshortfuse commentedon Apr 1, 2026
Welp, time to make an open OpenAI Codex extension.
ChatGPT Review
petterton commentedon Apr 9, 2026
Finally a working solution. And making a skill that tells Codex to always do it this way also helped
virtushda commentedon Apr 14, 2026
This is not working anymore either.
DustyShoe commentedon Apr 15, 2026
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
aoaoaoao-wu commentedon Apr 24, 2026
26.5422.21459好像已经修复了这一问题
aoaoaoao-wu commentedon Apr 24, 2026
但是最近的版本有一个git相关的错误,没有git init的项目codex扩展会后台循环某些进程导致高cpu占用
kelesmert commentedon Jun 16, 2026
is that fixed?
naipi11 commentedon Aug 19, 2026
A workaround that avoids the OS browser handoff is to stop using
file://links for workspace files:[README.md](README.md), or just the plain relative path.Limitation: this is only reliable for files inside the open workspace. Files outside the workspace still need to be opened explicitly, and this does not fix the extension's
file://click routing.naipi11 commentedon Sep 7, 2026
The issue is still open, and I do not have reliable evidence that current releases have fixed the Windows/macOS
file://click-routing problem.The older 26.5422.21459 report is not enough to establish a current fix, especially because later comments still report the regression. The temporary method remains:
[README.md](README.md), not afile://URL.This is a workaround, not an official fix.