`anysphere.remote-wsl` deterministically rejects `openTextDocument` for certain WSL files with "Files above 50MB cannot be synchronized with extensions" — files are <2 KB, plain VS Code with `ms-vscode-remote.remote-wsl` on the same workspace works fine

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

[Co-authored by Cursor AI]

When navigating from the References panel to certain files in a WSL2 workspace, Cursor throws:

CodeExpectedError: cannot open vscode-remote://wsl%2Bubuntu/<path>.tsx.
Detail: Files above 50MB cannot be synchronized with extensions.
    at pmd.$tryOpenDocument

The files in question are 1–30 KB. The same files open fine when accessed directly from the file tree or Ctrl+P or (file find panel) ctrl-shift-f — only the references extension path fails. Failure is deterministic per-file (the same files always fail, others always succeed), and persists across Cursor restarts, OS restarts, full cache purges, and a fresh install.

If the actual file is loaded into workspace, then the references work. After the file is loaded once, it will continue to work thereafter, even if shut fown. But, if I restart cursor, the failure recurs.

Tried disabling anyshpere-remote-ssh; did not make a difference

The same workspace, opened in stock Microsoft VS Code with ms-vscode-remote.remote-wsl, exhibits no failure.

Steps to Reproduce

Reproduction (deterministic on my workspace)

(a)

  1. Open a WSL2-hosted folder in Cursor (/home/<user>/dev/mustrd/poc).
  2. Navigate to a file that imports a target component, e.g. an import of CalendarStagesEditorScreen from frontend/src/components/screens/CalendarStagesEditorScreen.tsx.
  3. Right-click the import → “Find All References” (or “Go to Definition”).

(b)
4. Click the reference in the References panel.

Expected Behavior

Expected: the file shows the references and would open when clicked

Actual: does not show the references below (only the filename) and when I click the filename get error toast “cannot open … Detail: Files above 50MB cannot be synchronized with extensions.” File is 1.5 KB on disk.

Workaround: open the file via the file tree or Ctrl+P first, then click the reference — works every time once the file is in a buffer.

Operating System

Windows 10/11

Version Information

Environment

Version: 3.1.17 (user setup)
VSCode Version: 1.105.1
Commit: fce1e9ab7844f9ea35793da01e634aa7e50bce90
Date: 2026-04-19T19:33:58.189Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

  • WSL distro: Ubuntu (default, ext4 inside vhdx)
  • Anysphere extensions installed:
    • anysphere.remote-ssh 1.0.48 (2026-04-10)
    • anysphere.remote-wsl 1.0.13 (2026-03-29)
  • Other relevant extensions: Auto Rename Tag, ES7+ React snippets, Highlight Matching Tag (none of these are file-system providers)
  • No Microsoft remote extensions installed (no ms-vscode-remote.*)
  • AV: McAfee (default install on a new machine) — verified not the cause via VS Code cross-check on the same machine

Additional Information

Console error (Help → Toggle Developer Tools → Console)

[Extension Host] rejected promise not handled within 1 second:
  CodeExpectedError: cannot open vscode-remote://wsl%2Bubuntu/home/rohan/dev/mustrd/poc/frontend/src/components/screens/CalendarStagesEditorScreen.tsx.
  Detail: Files above 50MB cannot be synchronized with extensions.
    at pmd.$tryOpenDocument (vscode-file://vscode-app/c:/Users/rohan/AppData/Local/Programs/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:38268:11118)

File on disk (WSL side)

$ stat frontend/src/components/screens/CalendarStagesEditorScreen.tsx
  Size: 1581    Blocks: 8    IO Block: 4096    regular file
$ file frontend/src/components/screens/CalendarStagesEditorScreen.tsx
  JavaScript source, Unicode text, UTF-8 text
$ lsattr frontend/src/components/screens/CalendarStagesEditorScreen.tsx
  --------------e------- (no special attributes)

Plain UTF-8, ext4, no xattrs, no symlinks, single hardlink, owned by the workspace user. Identical to other files in the same directory that open without error.

Other startup errors that may or may not be related

ERR Unable to create workbench contribution 'remoteTerminalBackend'.
Error: A terminal backend with remote authority 'wsl+ubuntu' was already registered.
    at VCv.registerTerminalBackend ...
    at new nkl ...

ERR Extension 'anysphere.remote-ssh' appears in product.json but enables LESS API proposals than the extension wants.
package.json (LOSES): resolvers, tunnels, contribViewsRemote, terminalDataWriteEvent, cursorTracing, cursorNoDeps
product.json (WINS):  resolvers, tunnels, terminalDataWriteEvent, contribRemoteHelp, contribViewsRemote, telemetry, cursorTracing

ERR [LocalProcess1][resolveAuthority(wsl,1)][1850ms] returned an error Object

The duplicate wsl+ubuntu backend registration suggests anysphere.remote-ssh and anysphere.remote-wsl both register a handler for the same authority. Disabling anysphere.remote-ssh (leaving WSL only) silences the duplicate-backend error but does not fix the 50 MB issue — so the duplicate registration may be a separate bug.

Things ruled out

Hypothesis Verdict How verified
File actually >50 MB :cross_mark: stat shows 1.5 KB
File is binary / wrong encoding / has BOM :cross_mark: file says UTF-8 plain
Symlink / hardlink oddity :cross_mark: lsattr, stat -c '%h' clean
Stale Cursor workspace storage :cross_mark: Deleted %APPDATA%\Cursor\User\workspaceStorage\<hash>, reproduced after rebuild
Stale ~/.cursor-server cache on WSL :cross_mark: Deleted ~/.cursor-server/data/User/workspaceStorage, logs, CachedProfilesData, reproduced after rebuild
Stale WSL distro state :cross_mark: Full wsl --shutdown and OS reboot, reproduced
Cursor version :cross_mark: Updated to latest, reproduced
Conflicting Microsoft remote extensions :cross_mark: None installed
Tracked vs untracked file (git) :cross_mark: git add -N on a failing file did not fix it
Antivirus interference (McAfee on \\wsl.localhost\) :cross_mark: Plain VS Code with ms-vscode-remote.remote-wsl on the same workspace, same machine, McAfee unchanged does not reproduce
Duplicate WSL backend registration Likely unrelated Disabling anysphere.remote-ssh silences the duplicate-registration warning but the 50 MB issue persists

The VS Code cross-check is the strongest evidence that the bug is inside anysphere.remote-wsl (or how Cursor packages it), not below the IDE layer.

Hypothesis

anysphere.remote-wsl’s file-system provider returns an incorrect FileStat.size on stat for certain files (likely a stale or bogus value that exceeds the 20 MB tokenization / 50 MB extension-sync internal limits). When VS Code’s extension host calls workspace.openTextDocument(uri) from an extension (e.g. the references view), the size check rejects the open before content is ever read. Direct file-tree opens go through a different code path that doesn’t hit this check, which is why the workaround works.

Suggested investigation

  • Add logging in anysphere.remote-wsl’s FileSystemProvider.stat for the failing URIs and capture the returned FileStat.
  • Compare with the value ms-vscode-remote.remote-wsl returns for the same path on the same machine.
  • Check for any per-file caching keyed on inode or path that could be returning stale entries from a prior session.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. The level of detail is great: repro steps, cross-check with ms-vscode-remote.remote-wsl on the same workspace, ruled-out hypotheses, and the pointer to FileStat.size from the provider.

This is a bug on our side in anysphere.remote-wsl. Your hypothesis about an incorrect size returned by the FileSystemProvider matches the workaround. Preloading via the file tree seems to cache the correct buffer, and then References opens normally.

I’ve reported this to the engineers with a link to the thread. I can’t share an ETA for a fix yet, but I’ll post here once there’s an update. I’ll also add the duplicate wsl+ubuntu backend registration as a side finding, it looks like a separate issue.

For now, the workaround is to preload files via the file tree or Ctrl+P, like you described. Let me know if anything changes after the next update.

@deanrie I can confirm this bug also affects local multi-root workspaces on macOS (Apple Silicon, Sonoma) — no WSL or remote connection involved.

Same symptom: “Find All References” fails with “Files above 50MB cannot be synchronized with extensions” on ~5KB TypeScript source files that haven’t been opened in a buffer yet this session. Pre-opening the file via Cmd+P sometimes works around it, but not always. Reload Window does not help.

This suggests the incorrect FileStat.size from the FileSystemProvider isn’t specific to the WSL file system provider — it’s happening with local files too, at least in multi-root workspaces.


Also getting this on bare-metal Ubuntu with no WSL or remote connection involved

Thanks, this is an important addition. Your reports show the issue is broader than we first thought. The symptom happens not only in WSL, but also in a local multi-root workspace on macOS and on bare-metal Ubuntu without any remote connection. That suggests the root cause isn’t anysphere.remote-wsl itself, but a more general path through FileSystemProvider and References. I’ve added this to the existing issue so the scope is expanded beyond WSL.

There’s no fix yet, and I can’t share an ETA. The workaround is the same: pre-load the file via the file tree or Ctrl+P Cmd+P, and after that Find All References opens it normally for the rest of the session.

@matthew-bluewater, to match environments more precisely, can you share your Cursor version from Help > About and confirm whether this is a single-root or multi-root workspace. @craigkovatch, if Cmd+P doesn’t always help for you, any examples of files or patterns where it fails would be really helpful.

I’ll post here as soon as there’s an update on the fix.

Hey @Rohan_Coelho, I said I’d come back with an update, here it is.

Since your report, we changed how files that haven’t been opened in the editor yet get synced with extensions. There’s a good chance this fixes your case, but we’d like to confirm it on a real repro. Can you recheck on the latest version?

  1. Start a fresh Cursor session
  2. Run Find All References or Go to Definition on a symbol whose file you haven’t opened in this session yet
  3. Click a result in the References panel

One more workaround just in case: if the affected file has pending agent changes waiting for review, accepting or discarding those changes also clears the error.

If everything looks good, no need to reply. If it still reproduces on the latest version, please share updated details, the version from Help > About, and whether you’re in a single-root or multi-root workspace, and we’ll dig in more.

cc @craigkovatch @matthew-bluewater

I just ran into a similar issue on the latest Cursor version (3.18.25) where I was unable to run Go unit tests from the Test Explorer. In the Output tab under “Go” I found an error: “Failed to execute tests: CodeExpectedError: cannot open . Detail: Documents above the size limit cannot be synchronized with extensions.” The file in question was about 13KB in size. However when running the tests manually via the CLI go test ./..., they ran without issue.

After quitting Cursor and restarting I then noticed unaccepted agent changes (which I had previously accepted). I then accepted them again and after this the tests ran in the Test Explorer without issue. Not sure why I had to accept twice, but I’ve run into a similar issue with accepted changes in the past a couple times (haven’t noticed a particular pattern to when it happens).

Regardless, it would be helpful if there was better error messages or visibility related to this. Even just a reminder to look for pending agent changes in the error message would be helpful since the file-size warning is misleading.

Will give it a shot. Might be couple of days. I’m on different computer, different environment right now.

Hey @camm73, thanks for the detailed report. It’s especially helpful that this is on 3.18.25 and that you’re hitting it from Test Explorer, not via References, since that helps narrow down the issue. And your note that accepting or discarding pending agent changes makes the error go away is spot on. It looks like this is about files with unresolved agent changes, not the actual file size.

So for now, the workaround is: if a file has pending agent changes waiting for review, accept or discard them, or open the file first via the file tree or Ctrl+P. After that, the extension paths like References and Test Explorer work normally for the rest of the session.

Also agreed on the error message. The “size limit” text is misleading when the file is tiny. I’ll pass that along as feedback so the hint points to pending agent changes instead. I shared the new details with the team, and I’ll reply in the thread once there’s an update.

@Rohan_Coelho, no rush. Please test when you’re back on your setup and let us know how it goes.