IDE Context fails in Codex extension 26.715.x with RPC serialization error
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
- Install Codex IDE extension 26.715.31925.
- Open a workspace in VS Code or Devin.
- Enable IDE Context / automatic IDE context.
- Open a file, select some text, and keep multiple tabs open.
- Send a prompt through Composer.
- 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-contexterror 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.
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Confirming this remains reproducible with extension
26.721.41059, VS Code1.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-enabledremainstrue, 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-180940968b7cFull reproduction: #35333
I have not independently confirmed the exact RPC serialization exception reported here.
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:
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:
After applying that change and reloading the IDE, the
failed to fetch ide-contexterror stopped occurring and automatic IDE Context worked again. This was also the modification made in the installedout/extension.jsduring 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/Positioninstances.Previous long thread in https://github.com/openai/codex/issues/33978 is missing.
Still having issue in verison 26.721.41059 on Windows 10.
Environment
openai.chatgpt 26.727.4081626.715.xreleaseActual behavior
/idenormally often produces no visible response./ide,ide-context, or Composer error that explains why the UI was dismissed.Steps to reproduce
/ide.Expected behavior
/ideshould consistently open or enable the IDE-context 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/ideerror, or theTypeError: 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.You can fix this issue by editing the Codex extension’s
out\extension.jsfile.Find:
Replace it with:
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!
Additional reproduction on Windows 11 ARM64 with the official
openai.chatgptVS Code extension and Codex CLI 0.146.0.Environment
codex-cli 0.146.0C:\Users\lligu\GitHub\node-ansi-loggerReproduction
/ideto enable IDE Context.Explain the selected function and inspect related files in this repository.Actual behavior
/ideenables IDE Context temporarily.Relevant extension log excerpts
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
/ideis 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.Hi folks, thanks for the reports. This issue should be resolved in the Codex IDE extension as of:
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.