IDE Context fails in Codex extension 26.715.x with RPC serialization error

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

Environment

  • OS: Windows
  • Codex IDE extension: 26.715.31925
  • Also observed in: 26.707.91948 and 26.715.61943
  • IDEs tested: Visual Studio Code and Devin
  • GPT-5.6 is available in newer extension builds, but IDE Context is broken

Problem

IDE Context does not work in recent Codex extension versions. The extension logs:

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

The extension detects the active file, open tabs, and selected text, but this context is not included in the prompt. The Composer then silently disables or persists the IDE Context state as disabled.

The same behavior was reproduced in both VS Code and Devin, so this does not appear to be specific to one IDE installation.

Steps to reproduce

  1. Install Codex IDE extension 26.715.31925.
  2. Open a workspace in VS Code or Devin.
  3. Enable IDE Context / automatic IDE context.
  4. Open a file, select some text, and keep multiple tabs open.
  5. Send a prompt through Composer.
  6. Check the extension log or inspect the prompt payload.

Actual behavior

  • The IDE bridge can return the active file, open tabs, and selected text.
  • Sending the IDE context through the client-coordination RPC fails.
  • The prompt is sent without IDE context.
  • The log only shows [Composer] failed to fetch ide-context error={}.
  • The IDE Context state may be automatically disabled afterward.

The underlying error observed while instrumenting the provider was:

~~~text
OA.getIdeContext()
TypeError: Cannot serialize value: [object Object]
~~~

Expected behavior

The active file, open tabs, and selected text should be serialized and included automatically in the submitted prompt.

Root cause investigation

The IDE context provider returns VS Code / editor class instances, including selection-position objects, instead of plain JSON data. The client-coordination RPC serializer cannot serialize these class instances.

The failing implementation was:

~~~js
getIdeContext(e) {
return Promise.resolve(this.#e());
}
~~~

Normalizing the value to plain JSON fixes the RPC boundary:

~~~js
getIdeContext(e) {
return Promise.resolve(JSON.parse(JSON.stringify(this.#e())));
}
~~~

Verified workaround

After applying the JSON normalization above and reloading the IDE:

  • IDE Context remains enabled.
  • The active file is included in new prompts.
  • Open tabs are included in new prompts.
  • Selected text is included in new prompts.
  • The failed to fetch ide-context error no longer occurs.

The older extension version 26.5609.30741 also avoids this failure, but it does not provide GPT-5.6 support.

Suggested fix

Convert the IDE context result to a plain serializable object before sending it through the RPC layer. A structured normalization or explicit DTO mapping would be preferable if the payload shape is known.

Please consider adding a regression test that passes VS Code Selection / Position objects through getIdeContext() and verifies that the resulting RPC payload is JSON-serializable.

This appears to be an extension-side regression rather than an OpenAI service outage, account issue, or model problem.

View original on GitHub ↗

10 Comments

github-actions[bot] contributor · 1 month ago

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

  • #34696
  • #33978

Powered by Codex Action

ralphwest1 · 1 month ago

Confirming this remains reproducible with extension 26.721.41059, VS Code 1.130.0, and Windows 25H2.

It persists after reboot in a clean VS Code Temporary Profile containing only the official extension. In my reproduction, IDE Context remains enabled and composer-auto-context-enabled remains true, but no active filename or selected text reaches the prompt. Add to Codex Thread successfully attaches an explicit file/line reference.

Feedback ID: 019f989d-64b5-77b0-ac59-180940968b7c
Full reproduction: #35333

I have not independently confirmed the exact RPC serialization exception reported here.

ConelDEV · 1 month ago

Thanks for confirming that the IDE Context failure still reproduces on 26.721.41059, including in a clean Temporary Profile. Your results appear consistent with the same broader regression, even though the persisted toggle behavior differs between our reproductions.

For clarity, the RPC serialization exception in this issue was observed directly while instrumenting the extension-side IDE context provider on the affected builds. The provider returned editor/VS Code class instances—including selection and position objects—and the client-coordination RPC boundary rejected the value with:

OA.getIdeContext()
TypeError: Cannot serialize value: [object Object]

Normalizing the provider result to plain JSON before it crossed that RPC boundary immediately restored the active filename, open tabs, and selected text in prompts:

getIdeContext(e) {
  return Promise.resolve(JSON.parse(JSON.stringify(this.#e())));
}

After applying that change and reloading the IDE, the failed to fetch ide-context error stopped occurring and automatic IDE Context worked again. This was also the modification made in the installed out/extension.js during the verification.

Your observation that Add to Codex Thread still works is useful because it further suggests that explicit attachment and automatic IDE-context collection use different paths. Issue #35333 therefore looks complementary rather than contradictory: it confirms the user-facing regression on a newer build, while this issue documents one concrete failing RPC boundary and a verified local fix.

A proper upstream fix should preferably use an explicit serializable DTO rather than JSON round-tripping, and include a regression test covering VS Code Selection / Position instances.

cyhdzh · 1 month ago

Previous long thread in https://github.com/openai/codex/issues/33978 is missing.

Still having issue in verison 26.721.41059 on Windows 10.

changfenggu-code · 27 days ago

Environment

  • OS: Windows 11
  • IDE: Visual Studio Code
  • Current Codex extension: openai.chatgpt 26.727.40816
  • Authentication: API key
  • First affected version: the first observed 26.715.x release
  • Status: still reproducible across approximately five extension releases

Actual behavior

  1. Invoking /ide normally often produces no visible response.
  2. Intermittently, the IDE-context UI briefly appears in the Codex composer, then disappears almost immediately without user interaction.
  3. After it disappears, no IDE-context state remains visible and no active-file, selection, or open-tab context is available to the next prompt.
  4. There is no useful diagnostic output for this failure. In particular, local extension/runtime logs do not contain a /ide, ide-context, or Composer error that explains why the UI was dismissed.

Steps to reproduce

  1. Open a local workspace in VS Code on Windows 11.
  2. Open a regular local source file and select some text.
  3. Open the Codex sidebar.
  4. Invoke /ide.
  5. Observe either no response, or a context UI that flashes briefly and then disappears.

Expected behavior

  • /ide should consistently open or enable the IDE-context UI.
  • Once enabled, the UI should remain visible until the user disables it.
  • The next prompt should receive the active file, selection, and relevant open-tab context.
  • If context collection or attachment fails, the extension should show a visible error and emit a diagnostic log entry instead of silently removing the UI.

Investigation

I inspected the currently installed extension bundle. It contains an IDE-context collector for the active file, open tabs, and selection, plus a separate explicit attachment path (Add to Codex Thread).

However, in this reproduction I did not capture a local getIdeContext() failure, a /ide error, or the TypeError: Cannot serialize value: [object Object] described in issue #34920. Therefore this report confirms the user-visible UI regression and lack of diagnostics, but does not independently confirm the same serialization root cause.

ConelDEV · 23 days ago

You can fix this issue by editing the Codex extension’s out\extension.js file.

Find:

getIdeContext(e){return Promise.resolve(this.#e())}

Replace it with:

getIdeContext(e){return Promise.resolve(JSON.parse(JSON.stringify(this.#e())))}

Then restart the extension. The IDE context feature should work correctly afterward.

Important: If this bug is not fixed in the next extension version, you will need to apply the same modification again after updating the extension.

cyhdzh · 23 days ago
You can fix this issue by editing the Codex extension’s out\extension.js file. Find: getIdeContext(e){return Promise.resolve(this.#e())} Replace it with: getIdeContext(e){return Promise.resolve(JSON.parse(JSON.stringify(this.#e())))} Then restart the extension. The IDE context feature should work correctly afterward. Important: If this bug is not fixed in the next extension version, you will need to apply the same modification again after updating the extension.

Thank you ConelDEV! This fix works for me!

Luligu · 23 days ago

Additional reproduction on Windows 11 ARM64 with the official openai.chatgpt VS Code extension and Codex CLI 0.146.0.

Environment

  • OS: Windows 11 ARM64
  • IDE: VS Code
  • Codex CLI: codex-cli 0.146.0
  • Codex desktop app installed and working
  • Workspace: local Windows repository, e.g. C:\Users\lligu\GitHub\node-ansi-logger
  • Global Codex config only:
[windows]
sandbox = "elevated"

[projects.'c:\users\lligu\github\node-persist-manager']
trust_level = "trusted"

Reproduction

  1. Open a local repository in VS Code.
  2. Open the Codex extension and start a new chat.
  3. Run /ide to enable IDE Context.
  4. Confirm the IDE-context symbol appears in the composer.
  5. Select a function in the active editor.
  6. Send: Explain the selected function and inspect related files in this repository.
  7. Initially IDE Context may work, but after a short time the IDE-context symbol disappears from the composer.
  8. Sending the same prompt then produces a response asking which function is selected, proving that the active selection was not attached.

Actual behavior

  • /ide enables IDE Context temporarily.
  • The UI indicator disappears during the same extension session/chat.
  • Active-file/selected-text context is no longer attached.
  • The repository itself remains accessible, so this is specifically loss of live IDE context rather than loss of workspace access.

Relevant extension log excerpts

2026-08-05 11:29:45.805 [info] Activating Codex extension
2026-08-05 11:29:45.805 [info] [CodexMcpConnection] Spawning codex app-server
2026-08-05 11:29:47.284 [error] Request failed ... method=fs/readFile ... "The system cannot find the path specified. (os error 3)"
2026-08-05 11:29:58.909 [info] ... requestRuntimeWorkspaceRootCount=0 ...
2026-08-05 11:29:59.200 [error] Request failed ... method=fs/readDirectory ... "The system cannot find the path specified. (os error 3)"

The same extension session can otherwise read the repository and execute approved actions successfully. The Codex desktop app's IDE Context remains enabled and can read the IDE correctly, so the failure is isolated to the VS Code extension's IDE-context state/transport.

Expected behavior

Once /ide is enabled for the chat, the indicator should remain present and the active file, selected text, and open tabs should continue to be attached until the user explicitly disables IDE Context.

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.

Luligu · 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.

I confirm that is fixed now. Thanks.