codex icon indicating copy to clipboard operation
codex copied to clipboard

[VS Code Extension] IDE Context automatically disables after 3 seconds in version 26.5715.31925

Open septuagintks opened this issue 4 months ago • 4 comments

What version of the IDE extension are you using?

26.5715.31925

What subscription do you have?

Free

Which IDE are you using?

VS Code

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

Bug description

In both the stable and pre-release versions of the 26.5715.31925 release, the IDE Context feature cannot stay enabled.

After enabling IDE Context, it automatically turns off after about 3 seconds, or sometimes it fails to open at all. This is not just a UI issue — the functionality itself is actually disabled and no longer works.

Additionally, the enabled/disabled state is not inherited from the previous version. After updating to 26.5715.31925, the IDE Context state from the old version is lost.

Actual behavior

IDE Context automatically closes after approximately 3 seconds, or cannot be opened. The feature itself is disabled, not just hidden from the UI. The previous enabled state is not restored.

What steps can reproduce the bug?

  1. Install Codex extension version 26.5715.31925 (stable or pre-release).
  2. Open VS Code.
  3. Enable IDE Context.
  4. Wait for a few seconds.

What is the expected behavior?

IDE Context should remain enabled and continue providing context from the IDE. The previous version's enabled state should also be preserved after updating.

Additional information

No response

septuagintks avatar Jul 18 '26 08:07 septuagintks

I've got the same issue here since the latest update of Codex VSCode extension (26.715.31925).

VS Code info: Version: 1.129.1 (user setup) Date: 2026-07-17T15:35:09Z Electron: 42.6.0 ElectronBuildId: 14623276 Chromium: 148.0.7778.280 Node.js: 24.18.0 V8: 14.8.178.38-electron.0 OS: Windows_NT x64 10.0.19045

cyhdzh avatar Jul 19 '26 06:07 cyhdzh

Confirmed on a second platform with the actual affected extension version:

  • Codex VS Code extension: 26.715.31925 (darwin-x64)
  • VS Code: 1.129.1
  • OS: macOS 26, x86_64

Observed behavior:

  1. Run /ide-context.
  2. IDE context appears enabled for roughly 1-2 seconds.
  3. It automatically switches off.
  4. Further attempts to toggle it can become inert.
  5. Reloading the VS Code window and starting a fresh Codex thread do not fix it.
  6. Downgrading to 26.707.91948 immediately restores active-selection and open-file context.

I inspected the installed 26.715.31925 bundle and found a code path consistent with the failure:

  • The webview's IDE-context query calls the bridge with an empty workspaceRoot because the local workspace object is set to undefined and the request falls back to workspaceRoot: "".
  • The extension-host IDE-context handler explicitly rejects a falsey workspace root.
  • When that query errors, the composer effect calls setIsAutoContextOn(false), which explains the delayed snap-back.

This appears to be a deterministic regression in the published extension build rather than a user setting or stale window state.

MrRobot701 avatar Jul 19 '26 12:07 MrRobot701

I can confirm MrRobot701's solution works, and the same issue happened to me.

To downgrade, in VSCode: on the bar on top, type >Extension: Install Specific Version of Extension and when it's done, press "Restart Extensions" on extension's VSCode page.

pirvuandrei547 avatar Jul 19 '26 13:07 pirvuandrei547

Codex 5.6 Sol traced this end-to-end and produced a locally verified fix.

Environment

  • Codex VS Code extension: 26.715.31925 (darwin-arm64)
  • VS Code: 1.129.1
  • macOS

Observed failure

  1. The IDE bridge correctly returned activeFile, openTabs, and activeSelectionContent.
  2. Sending a prompt still omitted all IDE context.
  3. The extension log reported [Composer] failed to fetch ide-context.
  4. Instrumenting the actual provider confirmed that OA.getIdeContext() received the selected text, but the client-coordination RPC then failed with:
TypeError: Cannot serialize value: [object Object]

Confirmed cause OA.getIdeContext() returned VS Code Selection / Position class instances. The RPC serializer requires plain serializable objects.

Confirmed local fix in the installed extension's out/extension.js:

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

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

I also reset/forced the composer auto-context state so the IDE Context indicator remained enabled; that only restored the UI state. The JSON normalization above is what restored the actual payload.

After reloading VS Code, new prompts automatically included the active file, open tabs, and selected text. This was verified end-to-end in the submitted session payload. The workaround edits the installed extension and will be overwritten by an extension update.

TobbysGitHub avatar Jul 20 '26 18:07 TobbysGitHub

Still an issue in 26.721.30844 and 26.721.41059

This really ruins our team's productivity, VSCode extension does not see which file I have open, which text is selected, where the cursor at etc... Please, please release the fix since the bug has already been id'ed

alex-jitbit avatar Jul 25 '26 10:07 alex-jitbit