Codex Diff crashes with “Oops, an error has occurred” in VS Code on macOS

Resolved 💬 51 comments Opened Jul 24, 2026 by Furgon Closed Aug 3, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

Codex Diff is unusable in VS Code: after Codex edits files, opening the “Codex Diff” tab shows:

Oops, an error has occurred

This happens in every repository, including a newly opened workspace.

Environment:

  • macOS, Apple Silicon
  • VS Code 1.128.0
  • Codex extension: openai.chatgpt 26.721.30844

Git works correctly and git diff displays the changes.

What I tried:

  • Reopened the workspace
  • Created a new Codex chat
  • Cleared VS Code workspaceStorage
  • Reinstalled the Codex extension
  • Tested another repository
  • Confirmed there are no relevant third-party extensions installed

Relevant Codex log:
Request failed: fs/readFile — No such file or directory (os error 2)
Then:
editor-diff-page error boundary

Expected behavior:
Codex Diff should render the changed files and their diff.

Actual behavior:
The Codex Diff editor crashes before displaying any diff.

View original on GitHub ↗

51 Comments

alvinkonda · 1 month ago

Come on, guys, this is a must; we are waiting for a fix

il2dottore · 1 month ago

Same problem here. I can't view Diff.

syusukexrj · 1 month ago

same problem.
My development machine is on the company intranet and can't connect to external websites. There seem to be a lot of errors related to fetching css and js from OpenAI. Please consider the experience when there is no internet access.

Tom6662c · 1 month ago

same problem

joshuajohnso · 1 month ago

The same problem

WilliamSado · 1 month ago

同样的问题

AlexLup06 · 1 month ago

Just downgrade to a previous e.g. 26715.61943 which was from 4 days ago.

guilegarcia · 1 month ago

Same problem here!

WilliamSado · 1 month ago
只需降级到之前的版本,例如 26715.61943,该版本是 4 天前的。

Thats also have this problem

WilliamSado · 1 month ago
> 将降级到之前的版本,例如26715.61943,该版本是4天前的。 那款也有这个问题

Oh it works on openai.chatgpt-26.5623.141536

UltraBurstXD · 1 month ago

AI slop. It's happening on Linux too.

div-dhingra · 1 month ago

Dealing with this as well still

mauriziopinotti · 1 month ago

Please stop saying "same problem", you're just polluting everyone's inbox!

If you want to be notified about updates, use the "subscribe" button in the sidebar.
If you want to notify developers you have the same issue, add a reaction to the first post.
Adding a comment is useless.

PhilipAB · 1 month ago

Underlying issue

Update: This comment https://github.com/openai/codex/issues/35076#issuecomment-5069253239 already explains the underlying issue.

Related issue

This appears related to #18311, which reports the same exception on another non-thread Codex route, although that issue concerns the desktop mini-window rather than the diff page.

cebtenzzre · 1 month ago

works fine if you downgrade the extension to 26.715.61943 and disable auto-update.

maazsurti · 1 month ago

I am surprised that this still isn't fixed after 3-4 updates. They should start looking at the code a bit more before shipping.

acorsicanfrog · 1 month ago

Same here. MacOS as well.

molotovisq · 1 month ago

Same problem here, ubuntu 24.

Xhicko · 1 month ago

Same problem here, Windows 11 pro

orenk1 · 1 month ago

Also happens to me in Linux:

VSCODE "ABOUT" shows the following output:
Version: 1.130.0
Commit: 1b6a188127eeaf9194f945eb6eb89a657e93c54c
Date: 2026-07-22T14:55:04Z
Electron: 42.6.0
ElectronBuildId: 14623276
Chromium: 148.0.7778.280
Node.js: 24.18.0
V8: 14.8.178.38-electron.0
OS: Linux x64 6.1.0-51-amd64

Codex version: 26.721.41059

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"

LarryLaiJN · 1 month ago

I can reproduce the same issue.

Environment:

  • macOS 26.5.1 (25F80), Apple Silicon (arm64)
  • VS Code 1.129.1
  • Codex extension 26.721.41059
  • Git 2.50.1 (Apple Git-155)

Git itself works correctly, and the repository only has a small set of text changes. The Codex log shows the same errors:

  • fs/readFile: No such file or directory (os error 2)
  • editor-diff-page error boundary

Clicking Retry does not resolve it. VS Code's built-in Source Control diff continues to work normally.

philipwutw · 1 month ago

Same problem here. I can't view Diff.
PRETTY_NAME="Ubuntu 22.04.5 LTS"

lizef · 1 month ago

who can fix it,oh tadaye

LarryLaiJN · 1 month ago

Downgrade the extension to 26.715.61943 would be a temporary way to solve this issue.

works fine if you downgrade the extension to 26.715.61943 and disable auto-update.
lizef · 1 month ago

Confirmed, this workaround is valid.thanks a lot 兄弟

mean-cj · 1 month ago

Confirmed, Codex Diff on git worktree same problem, Windows 11 pro
Codex version: v26.721.41059

<img width="426" height="218" alt="Image" src="https://github.com/user-attachments/assets/9911e7b1-6356-4b8c-a1b3-35cb8b36f6ca" />

zhangqinghua1008 · 1 month ago

me too

2026-07-28 14:31:59.450 [error]
error boundary
componentStack="
at R (.../openai.chatgpt-26.721.41059/webview/assets/editor-diff-page-DVdvmt2c.js:1:1030)
at L (.../openai.chatgpt-26.721.41059/webview/assets/editor-diff-page-DVdvmt2c.js:1:643)
...
"
error={}
name=AppRoutes

Rushannn · 1 month ago

I can reproduce this on macOS Apple Silicon with:

  • VS Code 1.130.0
  • Codex extension 26.721.41059 stable
  • Codex extension 26.5721.30844 pre-release
  • A clean Git worktree and a newly created one-line change

The sidebar preview renders the diff correctly, but opening the full Codex Diff custom editor crashes in editor-diff-page with:

Oops, an error has occurred

The extension log contains:

  • Error fetching ... 403 ... /settings/user
  • React error boundary in editor-diff-page-DVdvmt2c.js
  • The actual error is logged as error={}, which hides message and stack

I also verified that this is unrelated to:

  • diff size — reproduced with one changed line
  • stale thread history
  • branch vs unstaged filter
  • workspace state
  • extension channel — reproduced on stable and pre-release
  • the repository itself — Git and the sidebar diff work correctly

Suggested fixes:

  1. Log error.message, error.name, and error.stack explicitly in the React error boundary instead of serializing Error as {}.
  2. Isolate per-file rendering failures so one failed file does not crash the entire EditorDiffPage.
  3. If fs/readFile fails, render the patch content already available to the sidebar, or show a per-file error with the resolved path.
  4. Verify whether the unauthenticated 403 /settings/user response leaves data required by the full diff editor undefined.
  5. Add an error boundary around each mapped diff item, not only around the complete route.

The sidebar has enough data to render the same one-line diff, so the full editor should be able to use that data as a fallback.

ERHUTUZI123 · 1 month ago

Temporary Workaround: Downgrade the Codex Extension

A temporary workaround is to downgrade the OpenAI Codex extension to version:

26.715.61943

This version appears to avoid the issue introduced in newer releases.

Steps to Reproduce the Workaround

  1. Open Visual Studio Code.
  1. Open the Extensions view:

``text
Ctrl + Shift + X
``

  1. Search for the OpenAI Codex extension.
  1. Open the extension details page.
  1. Click the gear icon next to the uninstall button.
  1. Select:

``text
Install Specific Version...
``

  1. Choose version:

``text
26.715.61943
``

  1. Reload the VS Code window after installation:

``text
Ctrl + Shift + P
``

Then run:

``text
Developer: Reload Window
``

Command-Line Alternative

The same version can be installed from the VS Code command line:

code --install-extension OpenAI.chatgpt@26.715.61943 --force

After the command completes, restart or reload VS Code.

Prevent Automatic Reinstallation of the Latest Version

To prevent VS Code from automatically upgrading the extension again:

  1. Open the extension details page.

2 Disable automatic updates check box for this extension.

Otherwise, VS Code may replace version 26.715.61943 with the latest release and cause the issue to return.

Ruizhi-Deng · 1 month ago

Version 26.715.61943 throws "Error creating chat Unknown local project" when i tried to create a new chat.
And the Diff problem hasn't been fixed yet.
Absolutely disappointing.

---
VSCode Versions

Version: 1.130.0
Commit: 1b6a188127eeaf9194f945eb6eb89a657e93c54c
Date: 2026-07-22T14:55:04Z
Electron: 42.6.0
ElectronBuildId: 14623276
Chromium: 148.0.7778.280
Node.js: 24.18.0
V8: 14.8.178.38-electron.0
OS: Linux x64 6.8.0-136-generic snap

xming521 · 1 month ago

same

Om2005Prakash · 29 days ago

Thanks @LarryLaiJN

hatmatty · 29 days ago

Same issue

1sMind · 29 days ago

sesame

jadmqt1 · 29 days ago

downgrad to 26.715.61943 and it will work 🎈🎈

akW-matt · 29 days ago
downgrad to 26.715.61943 and it will work 🎈🎈

Yep! Worked for me. Thanks!

AndresArdeuz · 28 days ago

Confirmed WSL2 workaround and regression boundary

I reproduced the full Codex Diff editor failure with a clean one-line text change.

Environment tested

  • Windows 11 x64 host
  • VS Code connected to a Debian WSL2 workspace
  • VS Code client and WSL server: 1.130.0
  • Also reproduced with VS Code 1.131.0
  • Codex extension: 26.721.41059

Behavior with 26.721.41059

  • The inline/sidebar diff rendered correctly.
  • VS Code Source Control diff rendered correctly.
  • Opening the dedicated Codex Diff editor failed with Oops, an error has occurred.
  • Reloading the window, testing a one-line change, and changing VS Code from 1.131.0 to 1.130.0 did not fix it.

Working procedure

  1. Downgrade only the Codex extension in the WSL extension host:

``bash
code --install-extension openai.chatgpt@26.715.61943 --force
``

  1. Disable automatic updates for the Codex extension (the selected extension was registered as pinned).
  2. Run Developer: Reload Window.
  3. Open Review again for the same one-line change.

Result

The dedicated Codex Diff editor rendered the exact one-line diff successfully after the downgrade. The test change was then removed and the Git worktree returned to its previous clean state.

This test isolates the failure to the 26.721.41059 extension line in this WSL2 setup; downgrading VS Code itself was not sufficient. No manual deletion of extension directories was required.

hellojacknorell · 28 days ago

This remains broken. I'm on Win11, and the git command for diff returns the right content, so the error is entirely within the Codex diff viewer.

lishiao144 · 28 days ago

Regression update: still broken in 26.727.40816, with an additional thread-context trigger

I previously analyzed the original failure in #35076. The problem is still present in the latest extension I tested, and the new bundle introduces another call that triggers the same exception.

Environment

  • Windows 11 x64
  • VS Code 1.130.0
  • Remote-SSH to Linux x86_64
  • Codex extension 26.727.40816
  • Bundle: editor-diff-page-CYrkK60A.js

The standalone Codex Diff editor still crashes with:

Thread context is unavailable for non-thread routes

The previously identified thread-only state read used as hostConfig is still present in the new bundle. I first reapplied the previous diagnostic workaround:

- x=m(ae)
+ x=void 0

However, this was no longer sufficient. The editor still crashed, and the React stack now pointed to:

R (.../editor-diff-page-CYrkK60A.js:1:1182)

That location maps to another call in EditorDiffPage:

let{commentProps:c}=l(o),d;

The standalone /diff route is configured with enablePullRequestComments: false, but it still initializes commentProps through a hook/state accessor that requires thread context.

As a second diagnostic workaround, I changed:

- let{commentProps:c}=l(o),d;
+ let c=void 0,d;

After applying both diagnostic changes to the local and Remote-SSH copies of the extension and reloading VS Code:

  • The full-editor Codex Diff rendered the actual changed files correctly.
  • The error boundary no longer appeared.
  • The Thread context is unavailable for non-thread routes exception was no longer raised.
  • The Codex sidebar continued to work normally.

This indicates that the original non-thread-route issue has not been fixed, and the newer release now has an additional thread-context dependency through commentProps.

These minified bundle edits are only diagnostic workarounds. The variable names are release-specific, and extension updates overwrite the changes.

Suggested source-level fix

The standalone /diff route should not unconditionally access thread-only context for either hostConfig or commentProps.

Possible fixes:

  1. Use an optional/non-throwing context accessor on non-thread routes.
  2. Move thread-only comment and host-config logic into a component rendered only when thread context exists.
  3. Pass the required values through the diff route state instead of reading thread-only atoms.
  4. Add a regression test for opening the full-editor Codex Diff on the standalone /diff route, including a Remote-SSH setup and enablePullRequestComments: false.

Please prioritize a source-level fix. This has remained broken across multiple extension releases, and users should not need to downgrade or patch generated bundles to use the Review/Diff editor.

ivankyu · 27 days ago

Can confirm it's still happening in 26.727.40816. Weekend is approaching, so hopefully there would be a fix on Friday night.

dieterm · 27 days ago

Workaround for Codex Diff crashes in VS Code extension 26.5727.40816

Summary

In Codex – OpenAI's coding agent for Visual Studio Code, opening a file or diff from chat can open a Codex Diff editor that immediately displays:

Oops, an error occured. Try again.

For the environment in which this issue was reproduced, the underlying error was:

Error: Thread context is unavailable for non-thread routes

The failure is in the webview frontend bundled with Codex extension version 26.5727.40816. The standalone diff page is registered as a non-thread route, but its renderer reads two stores that require a thread route:

  1. The diff-comment hook initializes thread-scoped state.
  2. The host-configuration selector reads the host from thread-scoped route state.

The workaround below prevents those two reads on the standalone diff page. It disables comments in that page and supplies the local VS Code host configuration directly. Diff rendering then works normally for a local Windows workspace.

[!WARNING] This is an unofficial, version-specific modification of a minified production bundle. Back up the file first. An extension update may overwrite the workaround, and the workaround should be removed after OpenAI ships an official fix.

Confirmed environment

  • Operating system: Windows, x64
  • Visual Studio Code: 1.130.0
  • VS Code commit: 1b6a188127eeaf9194f945eb6eb89a657e93c54c
  • Extension ID: openai.chatgpt
  • Extension display name: Codex – OpenAI's coding agent
  • Extension version: 26.5727.40816
  • Extension platform package: win32-x64
  • Affected asset: webview/assets/editor-diff-page-Bq5ms-pF.js

The full default path is:

%USERPROFILE%\.vscode\extensions\openai.chatgpt-26.5727.40816-win32-x64\webview\assets\editor-diff-page-Bq5ms-pF.js

Symptoms and reproduction

  1. Open a local folder or repository in VS Code.
  2. Open the Codex chat view.
  3. From a Codex response, open a changed file or unified diff in the Codex Diff editor.
  4. The new editor displays the generic error page instead of the diff.

The normal Codex extension log may only contain an unhelpful serialized error:

error={} name=AppRoutes

The useful error is visible in the webview/renderer console. Open the Command Palette and run Developer: Toggle Developer Tools, select Console, and reproduce the problem. The relevant exception is:

Thread context is unavailable for non-thread routes

Root cause

The affected file is minified into one long line. The relevant renderer originally contains these two expressions:

let{commentProps:c}=l(o),d;

and:

x=m(ae),C=S()

In this bundle:

  • l(o) resolves to the diff-comment hook, named Zan in the generated stack. It reads thread-scoped state even though the diff route was created with enablePullRequestComments: false.
  • ae is exported from the shared bundle as UO. That selector derives the current host configuration through a thread-route selector.
  • The standalone Codex Diff page has route kind other, not local-thread or another supported thread kind.
  • The shared selector intentionally throws Thread context is unavailable for non-thread routes for route kind other.

The supplied diff payload itself was valid. In the reproduced case it was a string containing a normal unified diff beginning with diff --git. The exception happened while establishing UI context, before the diff content could be rendered.

What the workaround changes

The workaround performs two exact replacements.

1. Disable comments in the standalone diff page

- let{commentProps:c}=l(o),d;
+ let c={enableComments:!1},d;

This avoids initializing the thread-dependent comment hook. The trade-off is that inline diff comments are disabled in this standalone panel.

2. Supply the local host configuration

- x=m(ae),C=S()
+ x={id:`local`,display_name:`Local`,kind:`local`},C=S()

This avoids the thread-dependent host selector while preserving local file access and full-content loading.

This second change is appropriate only for a local VS Code workspace. It should not be used unchanged for Remote SSH, WSL, Dev Containers, or another non-local execution host.

Automated PowerShell workaround

Close any existing Codex Diff editors before running this script. The script is deliberately strict:

  • It targets only extension version 26.5727.40816 on win32-x64.
  • It targets the exact hashed asset shipped in that version.
  • It requires each original fragment to occur exactly once.
  • It creates a timestamped backup before writing.
  • If Node.js is available, it validates the patched text as an ES module before writing it.
  • It stops without modifying the file if the bundle does not match expectations.

Run the following in PowerShell:

$extensionVersion = '26.5727.40816'
$extensionName = "openai.chatgpt-$extensionVersion-win32-x64"
$extensionsRoot = Join-Path $env:USERPROFILE '.vscode\extensions'
$extensionPath = Join-Path $extensionsRoot $extensionName
$assetPath = Join-Path $extensionPath 'webview\assets\editor-diff-page-Bq5ms-pF.js'

if (-not (Test-Path -LiteralPath $assetPath -PathType Leaf)) {
    throw "Expected Codex diff asset was not found: $assetPath"
}

$source = [System.IO.File]::ReadAllText($assetPath)

$oldCommentHook = 'let{commentProps:c}=l(o),d;'
$newCommentFallback = 'let c={enableComments:!1},d;'

$oldHostSelector = 'x=m(ae),C=S()'
$newLocalHost = 'x={id:`local`,display_name:`Local`,kind:`local`},C=S()'

$alreadyPatched =
    $source.Contains($newCommentFallback) -and
    $source.Contains($newLocalHost)

if ($alreadyPatched) {
    Write-Host 'The Codex Diff workaround is already installed.'
} else {
    $commentHookCount = [regex]::Matches(
        $source,
        [regex]::Escape($oldCommentHook)
    ).Count

    $hostSelectorCount = [regex]::Matches(
        $source,
        [regex]::Escape($oldHostSelector)
    ).Count

    if ($commentHookCount -ne 1) {
        throw "Expected one comment-hook anchor, found $commentHookCount. No file was changed."
    }

    if ($hostSelectorCount -ne 1) {
        throw "Expected one host-selector anchor, found $hostSelectorCount. No file was changed."
    }

    $patched = $source.Replace($oldCommentHook, $newCommentFallback)
    $patched = $patched.Replace($oldHostSelector, $newLocalHost)

    $nodeCommand = Get-Command node -ErrorAction SilentlyContinue
    if ($null -ne $nodeCommand) {
        $patched | & $nodeCommand.Source --input-type=module --check
        if ($LASTEXITCODE -ne 0) {
            throw 'ES-module syntax validation failed. No file was changed.'
        }
    } else {
        Write-Warning 'Node.js was not found; skipping the optional ES-module syntax check.'
    }

    $timestamp = Get-Date -Format 'yyyyMMdd-HHmmss'
    $backupPath = "$assetPath.backup-$timestamp"
    Copy-Item -LiteralPath $assetPath -Destination $backupPath

    $utf8WithoutBom = New-Object System.Text.UTF8Encoding($false)
    [System.IO.File]::WriteAllText($assetPath, $patched, $utf8WithoutBom)

    $written = [System.IO.File]::ReadAllText($assetPath)
    if (-not $written.Contains($newCommentFallback) -or
        -not $written.Contains($newLocalHost)) {
        Copy-Item -LiteralPath $backupPath -Destination $assetPath -Force
        throw "Post-write verification failed. The backup was restored from $backupPath"
    }

    Write-Host "Patched: $assetPath"
    Write-Host "Backup:  $backupPath"
}

After the script completes:

  1. Open the VS Code Command Palette.
  2. Run Developer: Reload Window.
  3. Open a new Codex Diff editor.
  4. Confirm that the diff header and changed lines render.

Manual workaround

The automated script is safer because the target file is minified. If a manual edit is necessary:

  1. Back up editor-diff-page-Bq5ms-pF.js.
  2. Open the file without formatting or re-minifying it.
  3. Replace exactly one occurrence of let{commentProps:c}=l(o),d; with let c={enableComments:!1},d;.
  4. Replace exactly one occurrence of x=m(ae),C=S() with `x={id:local,display_name:Local,kind:local},C=S()`.
  5. Save as UTF-8 without adding a byte-order mark if possible.
  6. Run Developer: Reload Window in VS Code.

Do not add a broad try/catch around the entire minified function unless you carefully preserve every closing brace. A missing brace can leave the final export declaration inside a function and produce the unrelated syntax error Unexpected token 'export'.

Verification

Check that both replacements are present

$assetPath = Join-Path $env:USERPROFILE '.vscode\extensions\openai.chatgpt-26.5727.40816-win32-x64\webview\assets\editor-diff-page-Bq5ms-pF.js'
$source = [System.IO.File]::ReadAllText($assetPath)

[pscustomobject]@{
    CommentFallbackInstalled = $source.Contains('let c={enableComments:!1},d;')
    LocalHostInstalled       = $source.Contains('x={id:`local`,display_name:`Local`,kind:`local`},C=S()')
    OldCommentHookPresent    = $source.Contains('let{commentProps:c}=l(o),d;')
    OldHostSelectorPresent   = $source.Contains('x=m(ae),C=S()')
}

The expected values are:

CommentFallbackInstalled : True
LocalHostInstalled       : True
OldCommentHookPresent    : False
OldHostSelectorPresent   : False

Optional ES-module syntax check

If Node.js is installed:

Get-Content -Raw -LiteralPath $assetPath | node --input-type=module --check

Success produces no output and exits with status code 0.

Rollback

The patch script prints the exact backup path it created. Restore it with:

Copy-Item -LiteralPath '<full backup path>' -Destination '<full editor-diff-page path>' -Force

Then run Developer: Reload Window.

To locate timestamped backups created by the script:

$assetPath = Join-Path $env:USERPROFILE '.vscode\extensions\openai.chatgpt-26.5727.40816-win32-x64\webview\assets\editor-diff-page-Bq5ms-pF.js'
Get-ChildItem -LiteralPath (Split-Path $assetPath) |
    Where-Object Name -like 'editor-diff-page-Bq5ms-pF.js.backup-*' |
    Sort-Object LastWriteTime -Descending

If no backup is available, uninstall the extension, close every VS Code window, rename the exact version directory to a recovery name, and reinstall the extension. Renaming is preferable to deleting because it preserves a recoverable copy.

Limitations and risks

  • The patch is tied to 26.5727.40816 and asset hash Bq5ms-pF. Do not force it onto another version or hash.
  • The workaround disables comments/annotations in the standalone Codex Diff page.
  • The hard-coded host configuration is for local VS Code workspaces only.
  • Extension updates can change filenames, minified identifiers, and internal APIs.
  • An update may overwrite the patched file. Reassess the issue before applying a new patch.
  • A same-version reinstall may leave an already modified extension directory in place. Verify the file contents rather than assuming reinstall restored the bundle.
  • Editing installed extension assets is unsupported and should be treated as a temporary workaround.
  • Other console errors, such as errors from mtxr.sqltools, are unrelated to this Codex Diff failure.

Suggested upstream fix

The production fix should not hard-code the local host. A robust implementation could do one of the following:

  1. Pass cwd, host ID/configuration, and any required conversation context into the standalone diff route when the host opens it.
  2. Make the host selector safe for route kind other when the route includes an explicit host configuration.
  3. Avoid initializing the comment hook when comments are disabled.
  4. Give the standalone diff page its own context provider rather than relying on a thread-route provider.

For Remote SSH, WSL, and Dev Containers, the correct host configuration should be forwarded by the extension host instead of inferred or hard-coded in the webview.

Bug report template

### Codex Diff crashes on a standalone non-thread route

**Environment**

- VS Code: 1.130.0 (commit 1b6a188127eeaf9194f945eb6eb89a657e93c54c)
- Codex extension: openai.chatgpt 26.5727.40816, win32-x64
- OS: Windows x64
- Workspace: local

**Steps to reproduce**

1. Open a local repository in VS Code.
2. Use Codex chat and open a changed file/diff from the conversation.
3. Observe the Codex Diff editor.

**Actual result**

The editor displays "Oops, an error occured. Try again." The AppRoutes error
boundary often serializes the exception as `error={}`.

The underlying renderer error is:

`Error: Thread context is unavailable for non-thread routes`

The valid unified-diff payload reaches `EditorDiffPage`, but rendering fails
before the diff is displayed.

**Technical finding**

In `webview/assets/editor-diff-page-Bq5ms-pF.js`, the standalone diff renderer
initializes the diff-comment hook (`Zan`) and reads the thread-scoped host
configuration selector (`UO`). The route is classified as `other`, for which
the shared thread-context selector intentionally throws.

Two local changes make the page render:

- Bypass the comment hook with `{enableComments: false}`.
- Replace the thread-scoped host selector with the local host configuration.

This indicates that the standalone diff route is missing an appropriate
context provider or explicit host configuration.

**Expected result**

The standalone Codex Diff editor should render the supplied unified diff
without requiring thread-route-only context. The correct host configuration
should be passed to the route so local and remote workspaces remain supported.

Status

This workaround was tested successfully with the exact environment listed above. Remove it when an official extension release fixes standalone Codex Diff routing/context initialization.

mean-cj · 27 days ago

The Codex diff feature works in version openai.chatgpt@26.715.61943, but it still contains a bug. Downgrading is not recommended.

When you click New Chat, the Agent continues working in the previous folder, even after you have switched to a different Project Folder.

The current version, codex 26.5727.40816, has fixed this issue. However, there is currently still a problem with the Codex diff feature.

AIRemux · 27 days ago
# Workaround for Codex Diff crashes in VS Code extension 26.5727.40816 ## Summary In Codex – OpenAI's coding agent for Visual Studio Code, opening a file or diff from chat can open a Codex Diff editor that immediately displays: `` Oops, an error occured. Try again. ` For the environment in which this issue was reproduced, the underlying error was: ` Error: Thread context is unavailable for non-thread routes ` The failure is in the webview frontend bundled with Codex extension version 26.5727.40816. The standalone diff page is registered as a non-thread route, but its renderer reads two stores that require a thread route: 1. The diff-comment hook initializes thread-scoped state. 2. The host-configuration selector reads the host from thread-scoped route state. The workaround below prevents those two reads on the standalone diff page. It disables comments in that page and supplies the local VS Code host configuration directly. Diff rendering then works normally for a local Windows workspace. Warning This is an unofficial, version-specific modification of a minified production bundle. Back up the file first. An extension update may overwrite the workaround, and the workaround should be removed after OpenAI ships an official fix. ## Confirmed environment * Operating system: Windows, x64 * Visual Studio Code: 1.130.0 * VS Code commit: 1b6a188127eeaf9194f945eb6eb89a657e93c54c * Extension ID: openai.chatgpt * Extension display name: Codex – OpenAI's coding agent * Extension version: 26.5727.40816 * Extension platform package: win32-x64 * Affected asset: webview/assets/editor-diff-page-Bq5ms-pF.js The full default path is: ` %USERPROFILE%\.vscode\extensions\openai.chatgpt-26.5727.40816-win32-x64\webview\assets\editor-diff-page-Bq5ms-pF.js ` ## Symptoms and reproduction 1. Open a local folder or repository in VS Code. 2. Open the Codex chat view. 3. From a Codex response, open a changed file or unified diff in the Codex Diff editor. 4. The new editor displays the generic error page instead of the diff. The normal Codex extension log may only contain an unhelpful serialized error: ` error={} name=AppRoutes ` The useful error is visible in the webview/renderer console. Open the Command Palette and run **Developer: Toggle Developer Tools**, select **Console**, and reproduce the problem. The relevant exception is: ` Thread context is unavailable for non-thread routes ` ## Root cause The affected file is minified into one long line. The relevant renderer originally contains these two expressions: let{commentProps:c}=l(o),d; and: x=m(ae),C=S() In this bundle: * l(o) resolves to the diff-comment hook, named Zan in the generated stack. It reads thread-scoped state even though the diff route was created with enablePullRequestComments: false. * ae is exported from the shared bundle as UO. That selector derives the current host configuration through a thread-route selector. * The standalone Codex Diff page has route kind other, not local-thread or another supported thread kind. * The shared selector intentionally throws Thread context is unavailable for non-thread routes for route kind other. The supplied diff payload itself was valid. In the reproduced case it was a string containing a normal unified diff beginning with diff --git. The exception happened while establishing UI context, before the diff content could be rendered. ## What the workaround changes The workaround performs two exact replacements. ### 1. Disable comments in the standalone diff page - let{commentProps:c}=l(o),d; + let c={enableComments:!1},d; This avoids initializing the thread-dependent comment hook. The trade-off is that inline diff comments are disabled in this standalone panel. ### 2. Supply the local host configuration - x=m(ae),C=S() + x={id:local,display_name:Local,kind:local},C=S() This avoids the thread-dependent host selector while preserving local file access and full-content loading. This second change is appropriate only for a local VS Code workspace. It should not be used unchanged for Remote SSH, WSL, Dev Containers, or another non-local execution host. ## Automated PowerShell workaround Close any existing Codex Diff editors before running this script. The script is deliberately strict: * It targets only extension version 26.5727.40816 on win32-x64. * It targets the exact hashed asset shipped in that version. * It requires each original fragment to occur exactly once. * It creates a timestamped backup before writing. * If Node.js is available, it validates the patched text as an ES module before writing it. * It stops without modifying the file if the bundle does not match expectations. Run the following in PowerShell: $extensionVersion = '26.5727.40816' $extensionName = "openai.chatgpt-$extensionVersion-win32-x64" $extensionsRoot = Join-Path $env:USERPROFILE '.vscode\extensions' $extensionPath = Join-Path $extensionsRoot $extensionName $assetPath = Join-Path $extensionPath 'webview\assets\editor-diff-page-Bq5ms-pF.js' if (-not (Test-Path -LiteralPath $assetPath -PathType Leaf)) { throw "Expected Codex diff asset was not found: $assetPath" } $source = [System.IO.File]::ReadAllText($assetPath) $oldCommentHook = 'let{commentProps:c}=l(o),d;' $newCommentFallback = 'let c={enableComments:!1},d;' $oldHostSelector = 'x=m(ae),C=S()' $newLocalHost = 'x={id:local,display_name:Local,kind:local},C=S()' $alreadyPatched = $source.Contains($newCommentFallback) -and $source.Contains($newLocalHost) if ($alreadyPatched) { Write-Host 'The Codex Diff workaround is already installed.' } else { $commentHookCount = [regex]::Matches( $source, [regex]::Escape($oldCommentHook) ).Count $hostSelectorCount = [regex]::Matches( $source, [regex]::Escape($oldHostSelector) ).Count if ($commentHookCount -ne 1) { throw "Expected one comment-hook anchor, found $commentHookCount. No file was changed." } if ($hostSelectorCount -ne 1) { throw "Expected one host-selector anchor, found $hostSelectorCount. No file was changed." } $patched = $source.Replace($oldCommentHook, $newCommentFallback) $patched = $patched.Replace($oldHostSelector, $newLocalHost) $nodeCommand = Get-Command node -ErrorAction SilentlyContinue if ($null -ne $nodeCommand) { $patched | & $nodeCommand.Source --input-type=module --check if ($LASTEXITCODE -ne 0) { throw 'ES-module syntax validation failed. No file was changed.' } } else { Write-Warning 'Node.js was not found; skipping the optional ES-module syntax check.' } $timestamp = Get-Date -Format 'yyyyMMdd-HHmmss' $backupPath = "$assetPath.backup-$timestamp" Copy-Item -LiteralPath $assetPath -Destination $backupPath $utf8WithoutBom = New-Object System.Text.UTF8Encoding($false) [System.IO.File]::WriteAllText($assetPath, $patched, $utf8WithoutBom) $written = [System.IO.File]::ReadAllText($assetPath) if (-not $written.Contains($newCommentFallback) -or -not $written.Contains($newLocalHost)) { Copy-Item -LiteralPath $backupPath -Destination $assetPath -Force throw "Post-write verification failed. The backup was restored from $backupPath" } Write-Host "Patched: $assetPath" Write-Host "Backup: $backupPath" } After the script completes: 1. Open the VS Code Command Palette. 2. Run **Developer: Reload Window**. 3. Open a new Codex Diff editor. 4. Confirm that the diff header and changed lines render. ## Manual workaround The automated script is safer because the target file is minified. If a manual edit is necessary: 1. Back up editor-diff-page-Bq5ms-pF.js. 2. Open the file without formatting or re-minifying it. 3. Replace exactly one occurrence of let{commentProps:c}=l(o),d; with let c={enableComments:!1},d;. 4. Replace exactly one occurrence of x=m(ae),C=S() with x={id:local,display_name:Local,kind:local},C=S() . 5. Save as UTF-8 without adding a byte-order mark if possible. 6. Run **Developer: Reload Window** in VS Code. Do not add a broad try/catch around the entire minified function unless you carefully preserve every closing brace. A missing brace can leave the final export declaration inside a function and produce the unrelated syntax error Unexpected token 'export'. ## Verification ### Check that both replacements are present $assetPath = Join-Path $env:USERPROFILE '.vscode\extensions\openai.chatgpt-26.5727.40816-win32-x64\webview\assets\editor-diff-page-Bq5ms-pF.js' $source = [System.IO.File]::ReadAllText($assetPath) [pscustomobject]@{ CommentFallbackInstalled = $source.Contains('let c={enableComments:!1},d;') LocalHostInstalled = $source.Contains('x={id:local,display_name:Local,kind:local},C=S()') OldCommentHookPresent = $source.Contains('let{commentProps:c}=l(o),d;') OldHostSelectorPresent = $source.Contains('x=m(ae),C=S()') } The expected values are: ` CommentFallbackInstalled : True LocalHostInstalled : True OldCommentHookPresent : False OldHostSelectorPresent : False ` ### Optional ES-module syntax check If Node.js is installed: Get-Content -Raw -LiteralPath $assetPath | node --input-type=module --check Success produces no output and exits with status code 0. ## Rollback The patch script prints the exact backup path it created. Restore it with: Copy-Item -LiteralPath '<full backup path>' -Destination '<full editor-diff-page path>' -Force Then run **Developer: Reload Window**. To locate timestamped backups created by the script: $assetPath = Join-Path $env:USERPROFILE '.vscode\extensions\openai.chatgpt-26.5727.40816-win32-x64\webview\assets\editor-diff-page-Bq5ms-pF.js' Get-ChildItem -LiteralPath (Split-Path $assetPath) | Where-Object Name -like 'editor-diff-page-Bq5ms-pF.js.backup-*' | Sort-Object LastWriteTime -Descending If no backup is available, uninstall the extension, close every VS Code window, rename the exact version directory to a recovery name, and reinstall the extension. Renaming is preferable to deleting because it preserves a recoverable copy. ## Limitations and risks * The patch is tied to 26.5727.40816 and asset hash Bq5ms-pF. Do not force it onto another version or hash. * The workaround disables comments/annotations in the standalone Codex Diff page. * The hard-coded host configuration is for local VS Code workspaces only. * Extension updates can change filenames, minified identifiers, and internal APIs. * An update may overwrite the patched file. Reassess the issue before applying a new patch. * A same-version reinstall may leave an already modified extension directory in place. Verify the file contents rather than assuming reinstall restored the bundle. * Editing installed extension assets is unsupported and should be treated as a temporary workaround. * Other console errors, such as errors from mtxr.sqltools, are unrelated to this Codex Diff failure. ## Suggested upstream fix The production fix should not hard-code the local host. A robust implementation could do one of the following: 1. Pass cwd, host ID/configuration, and any required conversation context into the standalone diff route when the host opens it. 2. Make the host selector safe for route kind other when the route includes an explicit host configuration. 3. Avoid initializing the comment hook when comments are disabled. 4. Give the standalone diff page its own context provider rather than relying on a thread-route provider. For Remote SSH, WSL, and Dev Containers, the correct host configuration should be forwarded by the extension host instead of inferred or hard-coded in the webview. ## Bug report template ### Codex Diff crashes on a standalone non-thread route **Environment** - VS Code: 1.130.0 (commit 1b6a188127eeaf9194f945eb6eb89a657e93c54c) - Codex extension: openai.chatgpt 26.5727.40816, win32-x64 - OS: Windows x64 - Workspace: local **Steps to reproduce** 1. Open a local repository in VS Code. 2. Use Codex chat and open a changed file/diff from the conversation. 3. Observe the Codex Diff editor. **Actual result** The editor displays "Oops, an error occured. Try again." The AppRoutes error boundary often serializes the exception as error={}. The underlying renderer error is: Error: Thread context is unavailable for non-thread routes The valid unified-diff payload reaches EditorDiffPage, but rendering fails before the diff is displayed. **Technical finding** In webview/assets/editor-diff-page-Bq5ms-pF.js, the standalone diff renderer initializes the diff-comment hook (Zan) and reads the thread-scoped host configuration selector (UO). The route is classified as other, for which the shared thread-context selector intentionally throws. Two local changes make the page render: - Bypass the comment hook with {enableComments: false}`. - Replace the thread-scoped host selector with the local host configuration. This indicates that the standalone diff route is missing an appropriate context provider or explicit host configuration. Expected result The standalone Codex Diff editor should render the supplied unified diff without requiring thread-route-only context. The correct host configuration should be passed to the route so local and remote workspaces remain supported. ## Status This workaround was tested successfully with the exact environment listed above. Remove it when an official extension release fixes standalone Codex Diff routing/context initialization.

work thanks

etraut-openai contributor · 26 days ago

Thanks for reporting the issue. We have a fix in place, and it will be included in the next release.

sgenGit · 25 days ago
4일 전 버전인 26715.61943으로 다운그레이드하면 됩니다.

와.. 진짜되네요 감사합니다

LarryLaiJN · 25 days ago

Even after updating the Codex extension to version 26.727.40816, the issue still persists. I hope this can be fixed soon.

samyouaret · 25 days ago

For anyone still experiencing this issue: in VS Code, open the Extensions view, find the Codex extension, and switch to the Pre-Release version. That resolved the issue for me on Ubuntu.

It's also likely that a stable release containing this fix will be available soon. Once it's released, you can switch back to the regular (stable) version of the extension.

dowista · 25 days ago

Still error with "26.721.30844" vscode extension on win10

orenk1 · 25 days ago
For anyone still experiencing this issue: in VS Code, open the Extensions view, find the Codex extension, and switch to the Pre-Release version. That resolved the issue for me on Ubuntu. It's also likely that a stable release containing this fix will be available soon. Once it's released, you can switch back to the regular (stable) version of the extension.

Solved. Thank you.
The pre-release version is : 26.5727.51351
Hopefully I will not get into pre-release bugs...

Undertrey · 24 days ago

Confirmed root cause and workaround

I reproduced this on:

  • Antigravity IDE: 1.107.0
  • Codex extension: 26.721.30844
  • Windows

The Diff page was failing for two reasons:
1) It attempted to read missing temporary files from disk. Disabling fullContentNextFallbackToDisk removed the original fs/readFile: No such file error.
2) It then crashed with the actual underlying exception:

Thread context is unavailable for non-thread routes

The standalone Diff page was reading the thread-scoped hostConfig, even though it runs as a non-thread route.
The following local fallback fixed the crash:

hostConfig = null

After applying both changes and restarting Antigravity, the changed-files list and Diff opened successfully. No downgrade was required.

This is only a local workaround and may be overwritten by an extension update. The proper upstream fix should avoid reading thread-scoped state from the standalone Diff route and gracefully handle missing temporary files.

m3thom · 11 days ago

In case anyone still uses version 26.715.61943 as a workaround just like me. I updated to the Codex extension openai.chatgpt 26.810.52044 and I no longer have this problem.