Markdown file:// links open in default browser (Edge) instead of VS Code editor

Open 💬 47 comments Opened Feb 24, 2026 by CT-2026

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).

View original on GitHub ↗

47 Comments

CT-2026 · 4 months ago

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:

  • OS: Windows 11 Pro 10.0.26200
  • VS Code: 1.109.5 (x64)
  • Extension: openai.chatgpt 0.5.78

Steps:
1) Open the Codex sidebar in VS Code
2) 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.

HumboldtK · 4 months ago

I have this issue as well

kelesmert · 4 months ago

I have this issue too it was ok 2 days ago

MadProff31 · 4 months ago

I'm seeing this as well. It isn't limited to Markdown; .asm files are also affected.

fender · 4 months ago

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 · 4 months ago

I have this issue as well

Klwildri · 4 months ago

yes i have it also

staytomorrow · 4 months ago

i have it also

HckSir · 4 months ago

我也有这个问题

Andreas-UI · 4 months ago

I encounter this issue with file+.vscode-resource.vscode-cdn.net/xxxxx

TasneemZh · 4 months ago

Same! It is affecting all of my files (csv, java, yml, tsx, etc)

CargoCultScientist · 4 months ago

Yes, same, it REALLY impedes my workflow.

ChinonsoO · 4 months ago

Just started having this issue after the 5.4 update

booogy · 4 months ago

the same annoying problem.

Dalomeve · 4 months ago

Repro update from Windows + Cursor

Environment

  • OS: Windows 11
  • IDE: Cursor
  • Extension: openai.chatgpt (Codex extension)

Repro steps

  1. Open a Codex sidebar thread.
  2. Click a local file link rendered in assistant output.
  3. The click resolves to a URL like https://file+.vscode-resource.vscode-cdn.net/... (sometimes with a trailing #).

Expected

  • Open the local file directly in an editor tab.

Actual

  • Opens in browser context or fails to open in editor.

Notes

  • Repro is consistent across multiple file types (.md, .html, .ts).
  • New thread does not reliably avoid the issue.
  • Local workaround is stable: decode URL path and open via code --goto / cursor --goto.
Dalomeve · 4 months ago

Workaround we are using on Windows (until extension-side fix lands):

$u = "https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/name/project/src/app.ts#"
$p = [System.Uri]::UnescapeDataString(($u -replace '^https://file\+\.vscode-resource\.vscode-cdn\.net/', '')) `
  -replace '[?#].*$','' `
  -replace '/', '\\'
cursor --goto $p   # or: code --goto $p

This consistently opens the expected local file and avoids the broken webview URL hop.

jmahotiedu · 4 months ago

Adding a more specific repro from VS Code on Windows 11.

Environment:

  • Codex VS Code extension: openai.chatgpt-26.304.20706-win32-x64
  • OS: Windows 11 Pro 10.0.26200

Observed behavior:

  • When Codex replies with a file path / file reference in chat and I click it, it opens my default browser instead of opening the local file in VS Code.
  • The URL that ends up in the browser looks like this:

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:

  • This suggests the click is being handled as a normal webview/browser link instead of a local-editor open.
  • In other words, it looks like the webview resource origin is leaking into the browser-open path rather than routing through VS Code file opening.

Impact:

  • Assistant-provided file references are not usable as editor navigation in VS Code on Windows.
  • It forces manual copy/paste of paths instead of direct open.

If helpful I can also provide a short screen recording / exact message format that triggered it.

wklovecyj · 4 months ago

I also have this problem

tajemniktv · 4 months ago

VSCode insider is also having this issue... Extremely annoying, can't lie

booogy · 4 months ago

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

aoaoaoao-wu · 4 months ago
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?

aoaoaoao-wu · 4 months ago
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

THANK YOU!!!

TonyGravagno · 4 months ago

Sincere appreciation to @booogy for the patch. Personally I'm not gonna use it, but huge kudos for your insight.

snow212-cn · 4 months ago

The problem will recur after the version is upgraded. Use this script to fix it with command:

node patch_openai_chatgpt_local_file_links.cjs

patch_openai_chatgpt_local_file_links.zip

abhinandangajar · 3 months ago

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

kiss10101 · 3 months ago

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:

powershell -ExecutionPolicy Bypass -File apply_codex_local_file_link_patch.ps1

apply_codex_local_file_link_patch_26.325.21211.zip

aoaoaoao-wu · 3 months ago
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 for compatibility, but the command-line statement executed has not changed, it is still:: powershell -ExecutionPolicy Bypass -File apply_codex_local_file_link_patch.ps1 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.

abhinandangajar · 3 months ago

@kiss10101 does it fix .json, .md or ,py file extension? I just want them to open in vscode itself.

aoaoaoao-wu · 3 months ago
> 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 for compatibility, but the command-line statement executed has not changed, it is still:: powershell -ExecutionPolicy Bypass -File apply_codex_local_file_link_patch.ps1 > 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.

Is OpenAI planning to abandon the IDE plugin and focus on the Codex app instead?

abhinandangajar · 3 months ago

@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?

kiss10101 · 3 months ago
@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+P in VS Code to bring up the management panel, and then run the Reload Window command?and pay attention that this is for a specific version :26.325.21211

kiss10101 · 3 months ago
@kiss10101 does it fix .json, .md or ,py file extension? I just want them to open in vscode itself.

@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 .yml

kiss10101 · 3 months ago

I 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

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,现在已更新至 26.325.21211 版本。 The content has been adjusted , but the command-line statement executed has not changed for compatibility, it is still:内容有所调整,但为兼容起见,执行的命令行语句并没有改变,仍然如此:
 powershell -ExecutionPolicy Bypass -File apply_codex_local_file_link_patch.ps1
apply_codex_local_file_link_patch_26.325.21211.zip
GnepZ · 3 months ago
I 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 > 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,现在已更新至 26.325.21211 版本。 The content has been adjusted , but the command-line statement executed has not changed for compatibility, it is still:内容有所调整,但为兼容起见,执行的命令行语句并没有改变,仍然如此: powershell -ExecutionPolicy Bypass -File apply_codex_local_file_link_patch.ps1 > apply_codex_local_file_link_patch_26.325.21211.zip

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.

snow212-cn · 3 months ago
The problem will recur after the version is upgraded. Use this script to fix it with command: node patch_openai_chatgpt_local_file_links.cjs patch_openai_chatgpt_local_file_links.zip

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.

woodlynn · 3 months ago

可以将这个脚本丢给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 · 3 months ago

This fucking bug has been around for two months already. Why the hell hasn't it been fixed yet? FK!

# Check cpp file 
[BBGameplayCueNotify_VoidRayCast.cpp:295](https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/zedrun/scoop/apps/vscode/1.108.2/data/extensions/openai.chatgpt-26.5325.21211-win32-x64/webview/) 

# jump to browser FK!
https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/zedrun/scoop/apps/vscode/1.108.2/data/extensions/openai.chatgpt-26.5325.21211-win32-x64/webview/

i try @kiss10101 apply_codex_local_file_link_patch.zip fix this bug, thx you

CargoCultScientist · 3 months ago

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 · 3 months ago

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 · 3 months ago

SAME! any link to a file in codex is opening in the browser rather than the editor..

clshortfuse · 3 months ago

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

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.
petterton · 3 months ago
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.

Finally a working solution. And making a skill that tells Codex to always do it this way also helped

virtushda · 3 months ago
A work around is to let the agent output the file path in the form of @PATH instead of default x form The backtip mark is included.

This is not working anymore either.

DustyShoe · 3 months ago
> A work around is to let the agent output the file path in the form of @path instead of default x form The backtip mark is included. 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

aoaoaoao-wu · 2 months ago

26.5422.21459好像已经修复了这一问题

aoaoaoao-wu · 2 months ago

但是最近的版本有一个git相关的错误,没有git init的项目codex扩展会后台循环某些进程导致高cpu占用

kelesmert · 1 month ago

is that fixed?