codex - 💡(How to fix) Fix Codex fails to open files in an already running IntelliJ IDEA instance and tries to start a second IDE process instead

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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

Root Cause

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.

RAW_BUFFERClick to expand / collapse

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex fails to open files in an already running IntelliJ IDEA instance and tries to start a second IDE process instead