Codex fails to open files in an already running IntelliJ IDEA instance and tries to start a second IDE process instead

Open 💬 2 comments Opened May 27, 2026 by showms

What version of the Codex App are you using (From “About Codex” dialog)?

26.519.81530

What subscription do you have?

plus

What platform is your computer?

windows11

What issue are you seeing?

When IntelliJ IDEA is already running, using "Open in IDEA" from the Codex App does not send the file to the existing IDEA window.

Instead, Codex appears to launch a new IDEA process. That second process fails with a directory lock error, so the file is not opened.

This makes the "Open in IDEA" action unusable while IDEA is already open, which is the normal workflow.

Error message:

com.intellij.platform.ide.bootstrap.DirectoryLock$CannotActivateException: Process "D:\Program Files\JetBrains\IntelliJ IDEA 2025.3\bin\idea64.exe" (18980) is still running and does not respond.

If the IDE is starting up or shutting down, please try again later.
If the process seems stuck, please try killing it (WARNING: unsaved data might be lost).

Additional stack trace details include:

  • DirectoryLock.lockOrActivate
  • StartupUtil.lockSystemDirs
  • java.net.SocketException: Invalid argument: bind
  • java.io.IOException: Unable to establish loopback connection
  • java.net.SocketException: Invalid argument: connect

IntelliJ version:

  • IntelliJ IDEA 2025.3

JRE shown in the error:

  • 21.0.8+9-b1163.69 amd64 (JetBrains s.r.o.)

What steps can reproduce the bug?

  1. Open IntelliJ IDEA and keep it running.
  2. Open the Codex App.
  3. Trigger the action that opens a file in IntelliJ IDEA from Codex.
  4. Observe that Codex tries to start a new IDEA process instead of reusing the already running IDEA instance.
  5. The new IDEA process fails with DirectoryLock$CannotActivateException and the file is not opened.

This is reproducible consistently on my machine.

Bundled codex CLI version on this machine:

  • 0.133.0

I do not have session id, token usage, or context window details for this issue because it appears unrelated to model execution and is specifically about app-to-IDE integration.

What is the expected behavior?

If IntelliJ IDEA is already open, Codex should reuse the existing IDEA instance and open the target file there, instead of trying to launch a second IDEA process.

The "Open in IDEA" action should work while IDEA is already running.

Additional information

This looks like an issue in how the Codex App invokes IntelliJ on Windows.

It seems likely that Codex is starting a new IDEA process instead of using the mechanism that forwards the open-file request to the existing IDEA instance.

Potentially relevant details:

  • OS: Windows x64
  • IntelliJ executable path:

D:\Program Files\JetBrains\IntelliJ IDEA 2025.3\bin\idea64.exe

  • The failure happens specifically when IDEA is already open.
  • If useful, I can provide the full stack trace and any additional environment details.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗