[Windows][26.820.60940 regression] Java NIO Selector.open fails with "Unable to establish loopback connection"
What version of the Codex App are you using (From “About Codex” dialog)?
26.820.60940
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
After installing Codex App 26.820.60940 on August 26, 2026, Java processes launched through Codex cannot initialize a Java NIO selector.
The first visible symptom was that this command stopped working:
~~~powershell
.\gradlew.bat compileJava
~~~
The Gradle wrapper starts Java, but the build fails before source compilation begins:
~~~text
FAILURE: Build failed with an exception.
- What went wrong:
java.io.IOException: Unable to establish loopback connection
~~~
Running with --no-daemon --stacktrace produces:
~~~text
java.io.UncheckedIOException: java.io.IOException: Unable to establish loopback connection
at org.gradle.internal.remote.internal.inet.SocketConnection.<init>(SocketConnection.java:64)
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connectToDaemon(DefaultDaemonConnector.java:271)
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startSingleUseDaemon(DefaultDaemonConnector.java:244)
Caused by: java.io.IOException: Unable to establish loopback connection
at java.base/sun.nio.ch.PipeImpl$Initializer.init(PipeImpl.java:96)
at java.base/sun.nio.ch.PipeImpl.<init>(PipeImpl.java:186)
at java.base/sun.nio.ch.WEPollSelectorImpl.<init>(WEPollSelectorImpl.java:78)
at java.base/sun.nio.ch.WEPollSelectorProvider.openSelector(WEPollSelectorProvider.java:33)
at java.base/java.nio.channels.Selector.open(Selector.java:295)
Caused by: java.net.SocketException: Invalid argument: connect
at java.base/sun.nio.ch.UnixDomainSockets.connect0(Native Method)
at java.base/sun.nio.ch.UnixDomainSockets.connect(UnixDomainSockets.java:126)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:947)
at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:281)
at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:123)
~~~
This is not specific to Gradle. The minimal Java reproducer in the reproduction section fails with the same exception when launched by Codex.
The same Gradle command and repository worked on August 25, before installing Codex App 26.820.60940. Restarting Windows did not resolve the problem.
The failure also occurs after approving elevated/out-of-sandbox execution for the command. Basic commands and java -version still run successfully.
What steps can reproduce the bug?
- Use Codex App 26.820.60940 on Windows.
- Start a local Windows task using PowerShell.
- Ask Codex to run the following command and approve execution if prompted:
~~~powershell
@(
'import java.nio.channels.Selector;'
'Selector.open();'
'/exit'
) | jshell --execution local
~~~
- Observe that Selector.open() fails with:
~~~text
java.io.IOException: Unable to establish loopback connection
Caused by: java.net.SocketException: Invalid argument: connect
~~~
- As a real-world reproduction, run a Gradle build:
~~~powershell
.\gradlew.bat compileJava
~~~
- Observe that Gradle fails while connecting to its daemon, before compilation begins.
Environment:
- Java: Amazon Corretto OpenJDK 26.0.2
- Gradle wrapper: 9.7.1
- Codex sandbox mode: workspace-write
- Restarting Windows does not resolve the failure
- Session/feedback ID: not available
What is the expected behavior?
Java processes launched by Codex should be able to initialize a local NIO selector.
Selector.open() should return a selector without throwing an exception, and Gradle should be able to connect to its local daemon and proceed with compilation, as it did before the Codex App update.
Additional information
Direct java -version execution succeeds:
~~~text
openjdk version "26.0.2" 2026-07-21
OpenJDK Runtime Environment Corretto-26.0.2.10.1
OpenJDK 64-Bit Server VM Corretto-26.0.2.10.1
~~~
A direct Pipe.open() call succeeds, but Selector.open() fails when WEPollSelectorImpl creates its internal loopback pipe. This narrows the problem to Java's Windows selector initialization rather than Java process startup or Gradle itself.
This may be a regression in the Windows command-runner or sandbox environment introduced by 26.820.60940, possibly affecting the Unix-domain socket used internally by Java's Windows WEPoll selector.
I searched the existing issue tracker. Issue #24726 contains the same Java exception in an IntelliJ-launching scenario, but no existing issue describes this Java/Gradle regression in version 26.820.60940.
Potentially related same-release Windows execution regression: #40817.
Host PowerShell control test
Running the identical JShell reproducer in an ordinary PowerShell window outside Codex succeeds:
~~~powershell
@(
'import java.nio.channels.Selector;'
'Selector.open();'
'/exit'
) | jshell --execution local
~~~
Output:
~~~text
$2 ==> sun.nio.ch.WEPollSelectorImpl@2a4fb17b
~~~
Inside Codex 26.820.60940, the same command fails with "Unable to establish loopback connection", even after approving elevated/out-of-sandbox execution. This isolates the regression to the Codex Windows command-runner environment rather than the installed JDK or Windows host.
2 Comments
java.io.IOException: Unable to establish loopback connection 我遇到了一样的问题,fuck gpt ,sb
I have the same issue. But I noticed that codex CLI works (version 0.149.1). But codex app seem to use codex-command-runner 0.150.0-alpha.8