VS Code IDE context auto-disables and selected text is not attached in WSL2

Resolved 💬 6 comments Opened Jul 26, 2026 by thisinnocence Closed Aug 13, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the IDE extension are you using?

26.721.41059

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

6.18.33.2-microsoft-standard-WSL2 x86_64 x86_64 GNU/Linux

What issue are you seeing?

Automatic IDE context initially appears enabled in the VS Code Codex
composer, but the IDE context indicator disappears after a short time.

Messages sent afterward do not include the active file or selected text.
Running /ide-context or reloading VS Code does not permanently fix it.

The extension log reports:

[Composer] failed to fetch ide-context error={}

The persisted composer-auto-context-enabled state is then changed to
false.

This reproduced after:

  • restarting WSL
  • restarting Windows
  • uninstalling and reinstalling the Codex extension in WSL

Steps to reproduce

  1. Open a repository using VS Code Remote - WSL.
  2. Open a normal file-backed editor.
  3. Select several lines.
  4. Open the Codex sidebar.
  5. Enable /ide-context.
  6. Wait briefly or send a message.
  7. Observe that the IDE context indicator disappears.
  8. Ask Codex to identify the selected lines.
  9. Observe that no active-file or selection context is attached.

Expected behavior

The IDE context setting should remain enabled, and each message should
include the active file, selected text, and open tabs.

Actual behavior

IDE context discovery fails, the setting is automatically disabled, and
selected text is omitted.

Additional diagnosis

The VS Code editor-side provider itself is working:

  • A standalone Codex CLI running in the same WSL workspace with /ide on

successfully receives the active file and exact selected text.

  • Therefore VS Code selection tracking and the IDE IPC socket are healthy.

Inspection of the clean-installed extension bundle showed that:

  • the non-Electron/VS Code path can request IDE context with an empty

workspaceRoot;

  • a discovery error automatically persists the IDE-context preference as

disabled;

  • the Webview clientCoordination path fails even though the editor-side

provider can return the selection.

A local workaround that preserves the enabled preference and retrieves the
selection directly through the VS Code host bridge restores IDE context
without changing VS Code, WSL, authentication, or network configuration.

This appears related to, but distinct from:

What steps can reproduce the bug?

Feedback ID: 019f9bde-3cda-77f2-8730-84e17b1237a0

What is the expected behavior?

When IDE context is enabled, it should remain enabled and visible in the Codex composer. Each message should automatically include the current active file, selected text, and open tabs. Reloading VS Code should preserve this setting, and transient IDE discovery failures should not disable it.

Additional information

I reproduced the issue on a clean installation before applying any local
changes.

As a diagnostic workaround, I modified the installed extension locally to:

  1. Always pass the actual workspace root when requesting IDE context,

instead of passing an empty string on the VS Code/non-Electron path.

  1. Prevent a transient IDE discovery failure from automatically persisting

composer-auto-context-enabled as disabled.

  1. Bypass the failing clientCoordination.getIdeContext() Webview RPC and

retrieve the current IDE context directly through a VS Code host bridge
backed by the extension's existing editor-selection provider.

After reloading VS Code, the Codex message correctly contained:

  • the active file path;
  • the exact selected lines;
  • the list of open tabs.

This confirms that VS Code selection tracking and the editor-side provider
were working, while the failure was in the extension's Webview/context
transport path.

This is only a local diagnostic workaround, not a proposed production patch.
It modifies generated extension bundle files and will be overwritten by an
extension update or reinstall.

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #34920
  • #34696
  • #35333

Powered by Codex Action

thisinnocence · 1 month ago
Potential duplicates detected. Please review them and close your issue if it is a duplicate. IDE Context fails in Codex extension 26.715.x with RPC serialization error #34920 IDE Context silently disables because workspaceRoot is missing in recent VS Code extension builds #34696 * VS Code /ide shows IDE context enabled but sends no active file or selection #35333 _Powered by Codex Action_

I reviewed #34696, #34920, and #35333.

This report overlaps with those issues, but adds a current
26.721.41059 reproduction specifically under VS Code Remote - WSL2.

In this reproduction:

  • the disappearing indicator and persisted disabled state match #34696;
  • supplying the actual workspaceRoot fixes IDE discovery, but the

clientCoordination IDE-context path still fails, which appears related
to #34920;

  • unlike #35333, the indicator disappears and the persisted preference is

changed to false;

  • a standalone Codex CLI in the same WSL workspace receives the exact

selection, confirming that the editor provider and IPC socket are healthy;

  • bypassing the failing Webview RPC through a VS Code host bridge restores

the active file, selected text, and open tabs.

I am leaving this open for maintainer triage because it documents the
current WSL2 behavior and the combined two-stage failure. I am happy for it
to be closed if maintainers confirm that it has the same root cause.

xming521 · 1 month ago

It happens not only on WSL2, but also on Ubuntu.

deweller · 25 days ago

This is also happening on my MacBook M5 Pro with every version after 26.707.91948.

deweller · 21 days ago

This appears to be fixed in 26.5803.41515 for me.

alexr-oai · 15 days ago

Hi folks, thanks for the reports. This issue should be resolved in the Codex IDE extension as of:

  • Stable: 26.803.41515, released August 7, 2026.
  • Pre-release: 26.5727.51351, released August 2, 2026.

Please update the Codex IDE extension to one of these versions or a newer version; if the issue persists after updating, please comment with your extension version, editor, and operating system and we can investigate further.